Changeset 10544 for trunk/Locale-Msgfmt


Ignore:
Timestamp:
02/06/10 05:44:05 (2 years ago)
Author:
adamk
Message:

Major refactoring of Local::Msgfmt, not it's compatible with Module::Install

Location:
trunk/Locale-Msgfmt
Files:
3 added
3 deleted
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Locale-Msgfmt

    • Property svn:ignore
      •  

        old new  
        1 Build 
         1inc 
        22blib 
        3 _build 
         3pm_to_blib 
         4Makefile 
        45META.yml 
        56MANIFEST 
        6 Makefile.PL 
  • trunk/Locale-Msgfmt/Changes

    r5967 r10544  
    11Revision history for Locale-Msgfmt 
     2 
     30.15    Feb 06, 2010 
     4        - General code cleaning 
     5        - Changes to Module::Install::Msgfmt to make it compatible with 
     6      Module::Install::Share. 
     7        - Moved script from bin/ to script/ 
     8        - Moved private tools from dev to private 
     9        - Picking 5.008005 as our minimum Perl to ensure solid Unicode support 
     10    - Converted the Build.PL to a Module::Install Makefile.PL 
    211 
    3120.14    Jul 09, 2009 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt.pm

    r5967 r10544  
    11package Locale::Msgfmt; 
    22 
    3 use Locale::Msgfmt::mo; 
    4 use Locale::Msgfmt::po; 
    5 use Locale::Msgfmt::Utils; 
    6 use File::Path; 
    7 use File::Spec; 
    8  
     3use 5.008005; 
    94use strict; 
    105use warnings; 
     6use Exporter              (); 
     7use File::Spec            (); 
     8use Locale::Msgfmt::mo    (); 
     9use Locale::Msgfmt::po    (); 
     10use Locale::Msgfmt::Utils (); 
    1111 
    12 use base 'Exporter'; 
    13  
    14 our @EXPORT = qw/msgfmt/; 
    15  
    16 our $VERSION = '0.14'; 
     12our $VERSION = '0.15'; 
     13our @ISA     = 'Exporter'; 
     14our @EXPORT  = qw/msgfmt/; 
    1715 
    1816sub do_msgfmt_for_module_install { 
     
    2018    my $sharepath = shift; 
    2119    my $fullpath  = File::Spec->catfile( $lib, $sharepath, 'locale' ); 
    22     if ( !-d $fullpath ) { 
    23         die("$fullpath isn't a directory"); 
     20    unless ( -d $fullpath ) { 
     21        die "$fullpath isn't a directory"; 
    2422    } 
    2523    msgfmt( { in => $fullpath, verbose => 1, remove => 1 } ); 
     
    2826sub msgfmt { 
    2927    my $hash = shift; 
    30     if ( !defined($hash) ) { 
    31         die("error: must give input"); 
     28    unless ( defined($hash) ) { 
     29        die "error: must give input"; 
    3230    } 
    33     if ( !( ref($hash) eq "HASH" ) ) { 
     31    unless ( ref($hash) eq "HASH" ) { 
    3432        $hash = { in => $hash }; 
    3533    } 
    36     if ( !defined( $hash->{in} ) or !length( $hash->{in} ) ) { 
    37         die("error: must give an input file"); 
     34    unless ( defined $hash->{in} and length $hash->{in} ) { 
     35        die "error: must give an input file"; 
    3836    } 
    39     if ( !-e $hash->{in} ) { 
    40         die("error: input does not exist"); 
     37    unless ( -e $hash->{in} ) { 
     38        die "error: input does not exist"; 
    4139    } 
    42     if ( !defined( $hash->{verbose} ) ) { 
     40    unless ( defined $hash->{verbose} ) { 
    4341        $hash->{verbose} = 1; 
    4442    } 
     
    5250sub _msgfmt { 
    5351    my $hash = shift; 
    54     if ( !defined( $hash->{in} ) ) { 
    55         die("error: must give an input file"); 
     52    unless ( defined $hash->{in} ) { 
     53        die "error: must give an input file"; 
    5654    } 
    57     if ( !-f $hash->{in} ) { 
    58         die("error: input file does not exist"); 
     55    unless ( -f $hash->{in} ) { 
     56        die "error: input file does not exist"; 
    5957    } 
    60     if ( !defined( $hash->{out} ) ) { 
    61         if ( $hash->{in} =~ /\.po$/ ) { 
    62             $hash->{out} = $hash->{in}; 
    63             $hash->{out} =~ s/po$/mo/; 
    64         } else { 
    65             die("error: must give an output file"); 
     58    unless ( defined $hash->{out} ) { 
     59        unless ( $hash->{in} =~ /\.po$/ ) { 
     60            die "error: must give an output file"; 
     61        } 
     62        $hash->{out} = $hash->{in}; 
     63        $hash->{out} =~ s/po$/mo/; 
     64    } 
     65    unless ( $hash->{force} ) { 
     66        my $min  = Locale::Msgfmt::Utils::mtime( $hash->{in} ); 
     67        my $mout = Locale::Msgfmt::Utils::mtime( $hash->{out} ); 
     68        if ( -f $hash->{out} and $mout > $min ) { 
     69            return; 
    6670        } 
    6771    } 
    68     unless ( $hash->{force} ) { 
    69         return 
    70             if ( -f $hash->{out} 
    71             && Locale::Msgfmt::Utils::mtime( $hash->{out} ) > Locale::Msgfmt::Utils::mtime( $hash->{in} ) ); 
    72     } 
    73     my $mo = Locale::Msgfmt::mo->new(); 
    74     $mo->initialize(); 
     72    my $mo = Locale::Msgfmt::mo->new; 
     73    $mo->initialize; 
    7574    my $po = Locale::Msgfmt::po->new( { fuzzy => $hash->{fuzzy} } ); 
    7675    $po->parse( $hash->{in}, $mo ); 
    77     $mo->prepare(); 
    78     unlink( $hash->{out} ) if ( -f $hash->{out} ); 
     76    $mo->prepare; 
     77    unlink( $hash->{out} ) if -f $hash->{out}; 
    7978    $mo->out( $hash->{out} ); 
    80     print $hash->{in} . " -> " . $hash->{out} . "\n" if ( $hash->{verbose} ); 
    81     unlink( $hash->{in} ) if ( $hash->{remove} ); 
     79    print $hash->{in} . " -> " . $hash->{out} . "\n" if $hash->{verbose}; 
     80    unlink( $hash->{in} ) if $hash->{remove}; 
    8281} 
    8382 
    8483sub _msgfmt_dir { 
    8584    my $hash = shift; 
    86     if ( !-d $hash->{in} ) { 
     85    unless ( -d $hash->{in} ) { 
    8786        die("error: input directory does not exist"); 
    8887    } 
    89     if ( !defined( $hash->{out} ) ) { 
     88    unless ( defined $hash->{out} ) { 
    9089        $hash->{out} = $hash->{in}; 
    9190    } 
    92     if ( !-d $hash->{out} ) { 
     91    unless ( -d $hash->{out} ) { 
    9392        File::Path::mkpath( $hash->{out} ); 
    9493    } 
    95     print $hash->{in} . " -> " . $hash->{out} . "\n" if ( $hash->{verbose} ); 
    96     opendir my $D, $hash->{in} or die "Could not open ($hash->{in}) $!"; 
    97     my @list = readdir $D; 
    98     closedir $D; 
     94 
     95    print "$hash->{in} -> $hash->{out}\n" if $hash->{verbose}; 
     96 
     97    local *DIRECTORY; 
     98    opendir( DIRECTORY, $hash->{in} ) or die "Could not open ($hash->{in}) $!"; 
     99    my @list = readdir DIRECTORY; 
     100    closedir DIRECTORY; 
     101 
    99102    my @removelist = (); 
    100103    if ( $hash->{remove} ) { 
     
    102105    } 
    103106    @list = grep /\.po$/, @list; 
     107 
    104108    my %files; 
    105     foreach (@list) { 
    106         my $in = File::Spec->catfile( $hash->{in}, $_ ); 
     109    foreach ( @list ) { 
     110        my $in  = File::Spec->catfile( $hash->{in}, $_ ); 
    107111        my $out = File::Spec->catfile( $hash->{out}, substr( $_, 0, -3 ) . ".mo" ); 
    108112        $files{$in} = $out; 
    109113    } 
    110114    foreach ( keys %files ) { 
    111         my %newhash = ( %{$hash} ); 
    112         $newhash{in}  = $_; 
    113         $newhash{out} = $files{$_}; 
    114         _msgfmt( \%newhash ); 
     115        _msgfmt( { %$hash, in  => $_, out => $files{$_} } ); 
    115116    } 
    116     foreach (@removelist) { 
     117    foreach ( @removelist ) { 
    117118        my $f = File::Spec->catfile( $hash->{in}, $_ ); 
    118         print "-$f\n" if ( $hash->{verbose} ); 
     119        print "-$f\n" if $hash->{verbose}; 
    119120        unlink($f); 
    120121    } 
     
    122123 
    1231241; 
     125 
     126=pod 
    124127 
    125128=head1 NAME 
     
    133136examples: 
    134137 
    135     use Locale::Msgfmt; 
     138  use Locale::Msgfmt; 
    136139 
    137     # compile po/fr.po into po/fr.mo 
    138     msgfmt({in => "po/fr.po", out => "po/fr.mo"}); 
    139     # compile po/fr.po into po/fr.mo and include fuzzy translations 
    140     msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1}); 
    141     # compile all the .po files in the po directory, and write the .mo 
    142     # files to the po directory 
    143     msgfmt("po/"); 
    144     # compile all the .po files in the po directory, and write the .mo 
    145     # files to the po directory, and include fuzzy translations 
    146     msgfmt({in => "po/", fuzzy => 1}); 
    147     # compile all the .po files in the po directory, and write the .mo 
    148     # files to the output directory, creating the output directory if 
    149     # it doesn't already exist 
    150     msgfmt({in => "po/", out => "output/"}); 
    151     # compile all the .po files in the po directory, and write the .mo 
    152     # files to the output directory, and include fuzzy translations 
    153     msgfmt({in => "po/", out => "output/", fuzzy => 1}); 
    154     # compile po/fr.po into po/fr.mo 
    155     msgfmt("po/fr.po"); 
    156     # compile po/fr.po into po/fr.mo and include fuzzy translations 
    157     msgfmt({in => "po/fr.po", fuzzy => 1}); 
     140  # Compile po/fr.po into po/fr.mo 
     141  msgfmt({in => "po/fr.po", out => "po/fr.mo"}); 
     142   
     143  # Compile po/fr.po into po/fr.mo and include fuzzy translations 
     144  msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1}); 
     145   
     146  # Compile all the .po files in the po directory, and write the .mo 
     147  # files to the po directory 
     148  msgfmt("po/"); 
     149   
     150  # Compile all the .po files in the po directory, and write the .mo 
     151  # files to the po directory, and include fuzzy translations 
     152  msgfmt({in => "po/", fuzzy => 1}); 
     153   
     154  # Compile all the .po files in the po directory, and write the .mo 
     155  # files to the output directory, creating the output directory if 
     156  # it doesn't already exist 
     157  msgfmt({in => "po/", out => "output/"}); 
     158   
     159  # Compile all the .po files in the po directory, and write the .mo 
     160  # files to the output directory, and include fuzzy translations 
     161  msgfmt({in => "po/", out => "output/", fuzzy => 1}); 
     162   
     163  # Compile po/fr.po into po/fr.mo 
     164  msgfmt("po/fr.po"); 
     165   
     166  # Compile po/fr.po into po/fr.mo and include fuzzy translations 
     167  msgfmt({in => "po/fr.po", fuzzy => 1}); 
    158168 
    159169=head1 COPYRIGHT & LICENSE 
     
    164174under the same terms as Perl itself. 
    165175 
    166  
    167176=cut 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt/Utils.pm

    r5968 r10544  
    11package Locale::Msgfmt::Utils; 
    22 
     3use 5.008005; 
    34use strict; 
    45use warnings; 
    56 
    6 our $VERSION = '0.14'; 
     7our $VERSION = '0.15'; 
    78 
    89sub character { 
     
    5859} 
    5960 
     611; 
     62 
     63__END__ 
     64 
     65=pod 
     66 
    6067=head1 NAME 
    6168 
    62 Locale::Msgfmt::Utils - functions used internally by Locale::Msgfmt 
     69Locale::Msgfmt::Utils - Functions used internally by Locale::Msgfmt 
    6370 
    6471=head1 SYNOPSIS 
     
    7178 
    7279=cut 
    73  
    74 1; 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt/mo.pm

    r5968 r10544  
    11package Locale::Msgfmt::mo; 
    22 
     3use 5.008005; 
    34use strict; 
    45use warnings; 
     6use Locale::Msgfmt::Utils (); 
    57 
    6 our $VERSION = '0.14'; 
    7  
    8 use Locale::Msgfmt::Utils; 
     8our $VERSION = '0.15'; 
    99 
    1010sub new { 
     
    2020 
    2121sub add_string { 
    22     my ( $self, $string, $translation ) = @_; 
    23     $self->{strings}->{$string} = $translation; 
     22    $_[0]->{strings}->{$_[1]} = $_[2]; 
    2423} 
    2524 
    2625sub prepare { 
    2726    my $self = shift; 
    28     $self->{count}    = scalar keys %{ $self->{strings} }; 
    29     $self->{free_mem} = 28 + $self->{count} * 16; 
    30     @{ $self->{sorted} }       = sort keys %{ $self->{strings} }; 
    31     @{ $self->{translations} } = (); 
    32     foreach ( @{ $self->{sorted} } ) { 
    33         push @{ $self->{translations} }, $self->{strings}->{$_}; 
    34     } 
     27    $self->{count}        = scalar keys %{ $self->{strings} }; 
     28    $self->{free_mem}     = 28 + $self->{count} * 16; 
     29    $self->{sorted}       = [ sort keys %{ $self->{strings} } ]; 
     30    $self->{translations} = [ 
     31        map { $self->{strings}->{$_} } @{ $self->{sorted} } 
     32    ]; 
    3533} 
    3634 
     
    6967} 
    7068 
     691; 
     70 
     71__END__ 
     72 
     73=pod 
     74 
    7175=head1 NAME 
    7276 
     
    8286 
    8387=cut 
    84  
    85 1; 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt/po.pm

    r5968 r10544  
    11package Locale::Msgfmt::po; 
    22 
    3 use Locale::Msgfmt::Utils; 
    4  
     3use 5.008005; 
    54use strict; 
    65use warnings; 
     6use Locale::Msgfmt::Utils (); 
    77 
    8 our $VERSION = '0.14'; 
     8our $VERSION = '0.15'; 
    99 
    1010sub new { 
     
    104104} 
    105105 
     1061; 
     107 
     108__END__ 
     109 
     110=pod 
     111 
    106112=head1 NAME 
    107113 
     
    117123 
    118124=cut 
    119  
    120 1; 
  • trunk/Locale-Msgfmt/lib/Module/Install/Msgfmt.pm

    r5968 r10544  
    11package Module::Install::Msgfmt; 
    22 
     3use 5.008005; 
    34use strict; 
    4 use File::Spec; 
     5use warnings; 
     6use File::Spec            (); 
    57use Module::Install::Base (); 
    6 use Module::Install::Share; 
    78 
    8 our $VERSION = '0.14'; 
     9our $VERSION = '0.15'; 
    910our @ISA     = 'Module::Install::Base'; 
    1011 
     
    1516    my $prefix    = $self->_top->{prefix}; 
    1617    my $name      = $self->_top->{name}; 
    17     my $dir       = @_ ? pop : 'share'; 
     18    my $dir       = @_ ? pop   : 'share'; 
    1819    my $type      = @_ ? shift : 'dist'; 
    1920    my $module    = @_ ? shift : ''; 
    20     $self->build_requires( 'Locale::Msgfmt' => '0.14' ); 
    21     install_share(@orig); 
     21    $self->build_requires( 'Locale::Msgfmt' => '0.15' ); 
     22    $self->install_share(@orig); 
    2223    my $distname = ""; 
    23  
    2424    if ( $type eq 'dist' ) { 
    2525        $distname = $self->name; 
     
    3535END_MAKEFILE 
    3636} 
     37 
     381; 
  • trunk/Locale-Msgfmt/t/00-load.t

    r5854 r10544  
    1 #!perl -T 
     1#!/usr/bin/perl 
    22 
     3use strict; 
     4BEGIN { 
     5    $|  = 1; 
     6    $^W = 1; 
     7} 
    38use Test::More tests => 1; 
    49 
    5 BEGIN { 
    6     use_ok('Locale::Msgfmt'); 
    7 } 
    8  
    9 diag("Testing Locale::Msgfmt $Locale::Msgfmt::VERSION, Perl $], $^X"); 
     10use_ok('Locale::Msgfmt'); 
  • trunk/Locale-Msgfmt/t/interface.t

    r5880 r10544  
    1 #!perl 
     1#!/usr/bin/perl 
    22 
     3use strict; 
     4BEGIN { 
     5    $|  = 1; 
     6    $^W = 1; 
     7} 
    38use Test::More tests => 8; 
    4  
    5 use Locale::Msgfmt; 
     9use File::Spec; 
    610use File::Temp; 
    711use File::Copy; 
    8 use File::Spec; 
    912use File::Path; 
     13use Locale::Msgfmt; 
    1014 
    1115sub slurp { 
    1216    my $file = shift; 
    13     open my $F, '<', $file or die "Could not open ($file) $!"; 
    14     binmode $F; 
    15     my $s = ""; 
    16     while (<$F>) { $s .= $_; } 
    17     close $F; 
    18     return $s; 
     17    local *FILE; 
     18    open FILE, '<', $file or die "Could not open ($file) $!"; 
     19    binmode FILE; 
     20    my $string = ""; 
     21    while ( <FILE> ) { 
     22        $string .= $_; 
     23    } 
     24    close FILE; 
     25    return $string; 
    1926} 
    2027 
    21 $dir = File::Temp::tempdir( CLEANUP => 0 ); 
     28my $dir = File::Temp::tempdir( CLEANUP => 0 ); 
    2229copy( File::Spec->catfile( "t", "samples", "basic.po" ), File::Spec->catfile( $dir, "basic.po" ) ); 
    2330msgfmt( File::Spec->catfile( $dir, "basic.po" ) ); 
    2431ok( -f File::Spec->catfile( $dir, "basic.mo" ) ); 
    2532unlink File::Spec->catfile( $dir, "basic.mo" ); 
     33 
    2634msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ) } ); 
    2735ok( -f File::Spec->catfile( $dir, "basic.mo" ) ); 
    2836unlink File::Spec->catfile( $dir, "basic.mo" ); 
     37 
    2938msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ), out => File::Spec->catfile( $dir, "mo" ) } ); 
    3039ok( -f File::Spec->catfile( $dir, "mo" ) ); 
    3140unlink( File::Spec->catfile( $dir, "mo" ) ); 
     41 
    3242mkdir( File::Spec->catdir( $dir, "a" ) ); 
    3343mkdir( File::Spec->catdir( $dir, "b" ) ); 
     
    3646ok( -f File::Spec->catfile( $dir, "a", "basic.mo" ) ); 
    3747unlink File::Spec->catfile( $dir, "a", "basic.mo" ); 
     48 
    3849msgfmt( { in => File::Spec->catdir( $dir, "a" ) } ); 
    3950ok( -f File::Spec->catfile( $dir, "a", "basic.mo" ) ); 
    4051unlink File::Spec->catfile( $dir, "a", "basic.mo" ); 
     52 
    4153msgfmt( { in => File::Spec->catdir( $dir, "a" ), out => File::Spec->catdir( $dir, "b" ), } ); 
    4254ok( -f File::Spec->catfile( $dir, "b", "basic.mo" ) ); 
    4355unlink( File::Spec->catfile( $dir, "b", "basic.mo" ) ); 
     56 
    4457move( File::Spec->catfile( $dir, "a", "basic.po" ), File::Spec->catfile( $dir, "basic.po" ) ); 
    4558msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ), fuzzy => 1, out => File::Spec->catfile( $dir, "fuzzy" ) } ); 
     
    4861unlink( File::Spec->catfile( $dir, "not_fuzzy" ) ); 
    4962unlink( File::Spec->catfile( $dir, "fuzzy" ) ); 
     63 
    5064move( File::Spec->catfile( $dir, "basic.po" ), File::Spec->catfile( $dir, "a", "basic.po" ) ); 
    5165msgfmt( { in => File::Spec->catfile( $dir, "a" ), fuzzy => 1, out => File::Spec->catfile( $dir, "b" ) } ); 
    5266msgfmt( { in => File::Spec->catfile( $dir, "a" ), out => File::Spec->catfile( $dir, "c" ) } ); 
    53 ok( !( slurp( File::Spec->catfile( $dir, "b", "basic.mo" ) ) eq slurp( File::Spec->catfile( $dir, "c", "basic.mo" ) ) ) 
    54 ); 
     67ok( !( slurp( File::Spec->catfile( $dir, "b", "basic.mo" ) ) eq slurp( File::Spec->catfile( $dir, "c", "basic.mo" ) ) ) ); 
    5568unlink( File::Spec->catfile( $dir, "c", "basic.mo" ) ); 
    5669unlink( File::Spec->catfile( $dir, "b", "basic.mo" ) ); 
    57  
  • trunk/Locale-Msgfmt/t/msgfmt.t

    r5956 r10544  
    1 #!perl 
     1#!/usr/bin/perl 
    22 
     3use strict; 
     4BEGIN { 
     5    $|  = 1; 
     6    $^W = 1; 
     7} 
    38use Test::More tests => 5; 
    4  
     9use File::Spec; 
     10use File::Temp; 
    511use Locale::Msgfmt; 
    6 use File::Temp; 
    7 use File::Spec; 
    812 
    913SKIP: { 
    10     skip "Test needs Locale::Maketext::Gettext", 5 if ( !eval("use Locale::Maketext::Gettext; 1;") ); 
     14    unless ( eval("use Locale::Maketext::Gettext; 1;") ) { 
     15        skip( "Test needs Locale::Maketext::Gettext", 5 ); 
     16    } 
    1117 
    1218    sub my_read_mo { 
    13         my %h = read_mo(shift); 
    14         return \%h; 
     19        return +{ read_mo(shift) }; 
    1520    } 
    1621 
     
    2025        my $in = shift; 
    2126        utime( undef, undef, $in ); 
    22         my $fuzzy = 0; 
    23         if (shift) { 
    24             $fuzzy = 1; 
    25         } 
     27        my $fuzzy = $_[0] ? 1 : 0; 
    2628        msgfmt( { in => $in, out => $filename, fuzzy => $fuzzy } ); 
    2729        return $filename; 
     
    5052    do_one_test("ngettext"); 
    5153} 
    52  
  • trunk/Locale-Msgfmt/t/version.t

    r5962 r10544  
    1 #!perl 
     1#!/usr/bin/perl 
    22 
     3use strict; 
     4BEGIN { 
     5    $|  = 1; 
     6    $^W = 1; 
     7} 
    38use Test::More tests => 2; 
    4 use Locale::Msgfmt; 
    5 use File::Spec; 
     9use File::Spec     (); 
     10use Locale::Msgfmt (); 
    611 
    712sub slurp { 
    8     open F, File::Spec->catfile(@_); 
    9     my @str = <F>; 
    10     my $str = join "", @str; 
    11     close F; 
    12     return wantarray ? @str : $str; 
     13    my $file = File::Spec->catfile(@_); 
     14    local *FILE; 
     15    open( FILE, '<', $file ) or die "open($file): $!"; 
     16    my @str = <FILE>; 
     17    my $str = join "", @str; 
     18    close FILE; 
     19    return wantarray ? @str : $str; 
    1320} 
    1421 
    15 my @all_bin = slurp("bin", "msgfmt.pl"); 
    16 my @all_pm = slurp("lib", "Locale", "Msgfmt.pm"); 
     22my @all_bin = slurp("script", "msgfmt.pl"); 
     23my @all_pm  = slurp("lib", "Locale", "Msgfmt.pm"); 
    1724my ($pm, $bin); 
    18 foreach(@all_bin) { 
    19     $_ =~ /^use Locale::Msgfmt (.*);$/; 
    20     $bin = $1 if($1); 
     25foreach( @all_bin ) { 
     26    $_ =~ /^use Locale::Msgfmt (.*);$/; 
     27    $bin = $1 if($1); 
    2128} 
    22 foreach(@all_pm) { 
    23     $_ =~ /^our \$VERSION = '(.*)';$/; 
    24     $pm = $1 if($1); 
     29foreach( @all_pm ) { 
     30    $_ =~ /^our \$VERSION = '(.*)';$/; 
     31    $pm = $1 if($1); 
    2532} 
    26 is($pm, $Locale::Msgfmt::VERSION); 
    27 is($bin, $pm); 
     33is( $pm, $Locale::Msgfmt::VERSION ); 
     34is( $bin, $pm ); 
Note: See TracChangeset for help on using the changeset viewer.