in reply to Checking the Ascendency/Descendency of Numeric Array of Any Size
use List::Util qw(reduce); sub is_asc { reduce { (defined($a) and $a < $b) ? $b : undef } @_ } print is_asc(1,2,3,4) ? 1 : 0, "\n"; print is_asc(1,3,2,4) ? 1 : 0, "\n"; 1 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checking the Ascendency/Descendency of Numeric Array of Any Size
by Eimi Metamorphoumai (Deacon) on Mar 23, 2007 at 15:40 UTC | |
by dk (Chaplain) on Mar 23, 2007 at 17:31 UTC | |
by Eimi Metamorphoumai (Deacon) on Mar 23, 2007 at 18:04 UTC | |
|