My code now looks like the following. It is a bit awkward to test. Please let me know if there are problems with it. I'll be back monday morning GMT.
sub Prioritise_requests { my ($input_directory) = @_; my $input_directory_lowest = $input_directory."1"; my $input_directory_highest = $input_directory."2"; readdir (LOWEST, "<$input_directory_lowest") or die "Error opening d +irectory: $!"; readdir (HIGHEST, "<$input_directory_highest") or die "Error opening + directory: $!"; 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 Re^4: Question mark regarding: my @lowest_priority = <LOWEST>; by Win
in thread Question mark regarding: my @lowest_priority = <LOWEST>; by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.