good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Good point. For complex checks (anything but simple ordering) division into smaller conditions is almost always better. This makes me think of another function that (1) packs all smaller tests into a subtest (so that it's "array is such-and-such" and not "ok 1, ok 2, ... ok 100500") and (2) provides access to adjacent array elements via $a and $b. Although possibly it should be just handed off to List::Util::foreach_adjacent (lame name off the top of my head) or smth. In reply to Re^2: A proper name for is_sorted function that can check more than just sorting order?
by Dallaylaen
|
|