in reply to Re: Checking the Ascendency/Descendency of Numeric Array of Any Size
in thread Checking the Ascendency/Descendency of Numeric Array of Any Size
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; }
|
|---|