Solved ... Slightly Round about .. but good enough for my 
class. I relise that this is very sloppy, scope wise and 
the way variables are being passed, but it works :)

thanks all who provided help.

sub Partition {

    ($A, $lower, $upper, my $min, my $max, $from) = @_;

    $n = $upper - $lower + 1;
    if ($n == "2") {
        if ($$A$lower < "$$A$upper") {
            $min = $$A$lower if $$A$lower < $min;
            $max = $$A$upper if $$A$upper > $max;
            $counter++;
        }
        elsif ($$A$upper < "$$A$lower") {
            $min = $$A$upper if $$A$upper < $min;
            $max = $$A$lower if $$A$lower > $max;
            $counter++;
        }
        return ($min,$max);
    }
    if ($upper <= "$lower") { 
        return ($min, $max);
    }
    
    $mid = int(($upper - $lower) / 2) + $lower;
    if ($$A$mid < "$min") {
        $min = $$A$mid;
        $counter++;
    }
    elsif ($$A$mid > "$max") {
        $max = $$A$mid;
        $counter++;
    }

    ($min, $max) = Partition($A,$lower,$mid,$min,$max,"part_1");
    ($min, $max) = Partition($A,$mid + 1,$upper2,$min,$max,"part_2");
    return($min,$max);
}

@A = (153, 1, 12, 65, 60, 214, 5, 21, 23, 19);

    $length = @A - 1;
    $mid    = 4;
    $min    = $A$mid;
    $max    = $A$mid;
    $min1   = $min;
    $max1   = $max;
    $mid1   = $mid;
    $upper2 = $mid;
    $counter = 0;

    ($min2, $max2) = Partition(\@A,0,$mid1,$min,$max,"main_1");
    $upper2 = $length;
    ($min3, $max3) = Partition(\@A,$mid1 + 1,$length,$min1,$max1,"main_2");

    if ($min2 < $min3) {
        $min = $min2;
    }
    else {
        $min = $min3;
    }
    if ($max2 > $max3) {
        $max = $max2;
    }
    else {
        $max = $max3;
    }

In reply to Re: finding min and max of array recursivly by Anonymous Monk
in thread finding min and max of array recursivly by mbond

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.