in reply to How to create the varibles with the file names
now all of your .txt files should be stored in the @files array.my @files; #reading directory opendir(MYDIR, "data"); my @contents = readdir MYDIR; #going through all files in directory foreach my $file(@contents) { #if file is a .txt if($file =~ m/\.txt$/) { #store file to array push(@files, $file); } } #closing directory handle closedir MYDIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to create the varibles with the file names
by softworkz (Monk) on Nov 15, 2005 at 21:03 UTC | |
by duff (Parson) on Nov 15, 2005 at 21:10 UTC | |
by mrpeabody (Friar) on Nov 16, 2005 at 16:26 UTC | |
|
Re^2: How to create the varibles with the file names
by duff (Parson) on Nov 15, 2005 at 21:06 UTC | |
|
Re^2: How to create the varibles with the file names
by Anonymous Monk on Nov 15, 2005 at 22:47 UTC |