in reply to Working with a unkown number of arrays
sub Prioritise_requests { my ($input_directory, $node) = @_; my %files; $files{1} = $input_directory."1"; $files{2} = $input_directory."2"; $files{3} = $input_directory,"3"; # this is looping on the directories in a prioritized manner foreach (sort keys %files) { open(*DATA,$_) or die; # this is looping through each file you want in each directory foreach (sort grep(/^Flat_file.*\.txt$/,readdir(DATA))) { # do your stuff for each file } close(DATA); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Working with a unkown number of arrays
by polettix (Vicar) on Feb 05, 2007 at 19:28 UTC | |
by ikegami (Patriarch) on Feb 06, 2007 at 05:36 UTC | |
by wojtyk (Friar) on Feb 05, 2007 at 22:35 UTC | |
|
Re^2: Working with a unkown number of arrays
by wojtyk (Friar) on Feb 05, 2007 at 17:04 UTC | |
by davorg (Chancellor) on Feb 05, 2007 at 17:08 UTC | |
by f00li5h (Chaplain) on Feb 06, 2007 at 10:38 UTC |