use strict; use warnings; use Fatal qw(chdir open); my ($dir_name) = @ARGV; chdir $dir_name; for my $file (grep {-f} glob '*') { open my $reader, '<', $file; print "Just opened $file.\n"; while (<$reader>) { # Did you want to do anything besides read the file? } print "Just finished reading $file.\n"; }
In reply to Re: Directory name as command line argument
by Narveson
in thread Directory name as command line argument
by max210
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |