go ahead... be a heretic | |
PerlMonks |
Re^3: So what is an array slice anyway?by Aristotle (Chancellor) |
on Aug 26, 2004 at 08:13 UTC ( [id://385933]=note: print w/replies, xml ) | Need Help?? |
Here's an idiomatic way to test whether the contents of two arrays are equal — assuming the elements are numbers, anyway.
In scalar context, grep evaluates to the number of elements it returned, so that condition says "if both arrays have the same length, and if no elements are found which are not equal". Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|