in reply to reading in multiple files froma linux directory

You can set @ARGV to the list of files in a BEGIN block:

# do a line count of all my .pl files: BEGIN { @ARGV=glob("*.pl") } my $i = 0; while (<>) { $i++; } print "$i\n";