
Chris Charley
User
Mar 13, 2013, 5:54 PM
Views: 114
|
|
Re: [oldrob] modifying a program to open all files in a directory
|
|
|
chomp(@buffer = <$fh>); #copy the entire line to @buffer This doesn't copy line 3 to @buffer. It copies lines 3 to eof to the buffer. Update: Ok, I guess thats what you want the program to do - sorry. You can use the glob function to get files like below.
my $dir = shift @ARGV; my @cvs_files = glob "$dir/*.csv"; You would just need to specify your directory on the command line immediately after the program, like perl my_program.pl dir_name
(This post was edited by Chris Charley on Mar 14, 2013, 8:59 AM)
|