Help for this page

Select Code to Download


  1. or download this
    my $root = rel2abs (shift || '.');
    
  2. or download this
    my @extList = @ARGV;
      
    @extList = ('pl', 'pm') if ! exists $extList[0];
    
  3. or download this
    my @extList = @ARGV ? @ARGV : qw/pl pm/;
    
  4. or download this
    my $lines = 0;
    my $files = 0;
    
  5. or download this
    my ($lines, $files); # is clear enough
    
  6. or download this
    sub count
    {
    my $name = $File::Find::name;
    return if -d $name;
    
  7. or download this
    my ($ext) = $name =~ /\.([^.]*)$/;
    return if ! defined $ext or ! exists $exts{$ext};
    
  8. or download this
    return if grep $name =~ /\.\Q$_$/, @extList;
    
  9. or download this
    return if ! open inFile, '<', $name;
    
  10. or download this
    open my $in, '<', $name or  # and I don't need close()
       (warn "Ouch: $name => $!\n"), return;
    
  11. or download this
    ++$lines while (<inFile>);
    
  12. or download this
    $lines+=<$in>;