in reply to Checking the Ascendency/Descendency of Numeric Array of Any Size

sub isAscending{ $_[0] < $_[1] and shift() or return 0 while @_>1; return 1; }

Update: A less clumbsy formulation

sub isAscending{ ( $_[0] < $_[1] or return 0 ), shift while @_ > 1; return 1; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Checking the Ascendency/Descendency of Numeric Array of Any Size
by varian (Chaplain) on Mar 23, 2007 at 12:35 UTC
    Creative solution!

    However it would fail for a list containing an element with value zero since in that case the shift operation returns a false result.
    This should fix it:

    sub isAscending2{ $_[0] < $_[1] and (shift() or 1) or return 0 while @_>1; return 1; }