Skip Menu |

This queue is for tickets about the Locale-US CPAN distribution.

Report information
The Basics
Id: 56989
Status: resolved
Worked: 1.2 hours (75 min)
Priority: 0/
Queue: Locale-US

People
Owner: metaperl [...] gmail.com
Requestors: stevet [...] ibrinc.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.2
Fixed in: (no value)



Subject: Locale::US fails after second call to new
If you do the following: use Locale::US; my $u = Locale::US->new(); # ok my $u2 = Locale::US->new(); # fails Patch file, adds: my $start_pos = tell( DATA ); prior to reading, and: seek( DATA, $start_pos, 0 ); to after reading.
Subject: locale_us.patch
--- US.pm 2010/04/27 20:42:06 1.1 +++ US.pm 2010/04/27 16:42:44 @@ -36,6 +36,7 @@ my $class = shift; my $self = {} ; + my $start_pos = tell( DATA ); while ( <DATA>) { chomp; @@ -45,6 +46,8 @@ $self->{code2state}{$code} = $state; $self->{state2code}{$state} = $code; } + + seek( DATA, $start_pos, 0 ); # warn Dumper $self; bless $self, $class;
excellent patch. sorry for delay.
From: paul [...] city-fan.org
On Tue Aug 02 17:35:11 2011, TBONE wrote: Show quoted text
> excellent patch. sorry for delay.
Here's an additional patch to add a regression test for this.
Subject: Locale-US-2.112140-rt56989.patch
--- Locale-US/t/1.t +++ Locale-US/t/1.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test; -BEGIN { plan tests => 3 }; +BEGIN { plan tests => 4 }; use Locale::US; ok(1); # If we made it this far, we're ok. @@ -32,4 +32,8 @@ ok ( $u->{state2code}{$state}, $code ); - +# rt #56989 Locale::US fails after second call to new +my $v = Locale::US->new(); +ok ( + $v->{code2state}{$code}, $state +);
fixed and uploaded. sorry for the delay.