Ignore:
Timestamp:
11/16/08 20:35:10 (4 years ago)
Author:
OlivierRaginel
Message:

Item38: Removed backticks: Use File::Find and open,while(<>)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/tools/check_manifest.pl

    r14 r744  
    33# cruise back up the tree until we find lib and data subdirs 
    44require Cwd; 
     5use File::Find; 
    56 
    67my @cwd = split(/[\/\\]/, Cwd::getcwd()); 
     
    3031my $manifest = 'lib/MANIFEST'; 
    3132unless (-f $manifest) { 
    32     $manifest = `find $root/lib/TWiki -name 'MANIFEST' -print`; 
    33     chomp $manifest; 
     33    File::Find::find( sub { /^MANIFEST\z/ && ( $manifest = $File::Find::name ) 
     34                          }, "$root/lib/TWiki" ); 
    3435} 
    3536die "No such MANIFEST $manifest" unless -e $manifest; 
     
    3738my %man; 
    3839 
    39 map{ s/ .*//; $man{$_} = 1; } 
    40   grep { !/^!include/  } 
    41   split(/\n/, `cat $manifest` ); 
     40open MAN, "< $manifest" or die "Can't open $manifest for reading: $!"; 
     41while( <MAN> ) { 
     42    next if /^!include/; 
     43    $man{$1} = 1 if /^(\S+)\s+\d+$/; 
     44  } 
     45close MAN; 
    4246 
    4347my @lost; 
Note: See TracChangeset for help on using the changeset viewer.