Update: Will the $request_of_interest contain the directory location as well as the file name. (that is what I want it to do).sub Prioritise_requests { my $input_directory = @_; my $input_directory_lowest = $input_directory."1"; my $input_directory_highest = $input_directory."2"; opendir (LOWEST, "<$input_directory_lowest"); #opendir fix opendir (HIGHEST, "<$input_directory_highest"); #open dir fix (previ +ously just open)... see messages below for details my @lowest_priority = <LOWEST>; my $request_of_interest = 'none'; foreach (@lowest_priority){ # foreach low priority request my @highest_priority = <HIGHEST>; # fill high_priority array if (@highest_priority) { # If there are elements in the array #Do nothing } else { $request_of_interest = $_; } if (@highest_priority) { foreach (@highest_priority){ # foreach high priority request $request_of_interest = $_; return $request_of_interest; } return $request_of_interest; } } }
In reply to Question mark regarding: my @lowest_priority = <LOWEST>; by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |