Help for this page

Select Code to Download


  1. or download this
    foreach my $file (<*.txt>) {
       open(FILE,"< $file") or die "Cannot open $file - $!\n";
       # Read in from FILE and do stuff with it...
    }
    
  2. or download this
    @ARGV = <*.txt>;
    while (<>) {
    ...
        # each line placed in $_.  You can see which file
        # you're currently reading from by looking at $ARGV.
    }