Mar 13, 2013, 5:54 PM
Re: [oldrob] modifying a program to open all files in a directory
This doesn't copy line 3 to @buffer. It copies lines 3 to eof to the buffer.
chomp(@buffer = <$fh>); #copy the entire line to @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.
You would just need to specify your directory on the command line immediately after the program, like perl my_program.pl dir_name
my $dir = shift @ARGV;
my @cvs_files = glob "$dir/*.csv";
(This post was edited by Chris Charley on Mar 14, 2013, 8:59 AM)