Re: Comparison result capture???by chip (Curate)
|on May 14, 2003 at 16:22 UTC ( #258148=note: print w/replies, xml )||Need Help??|
You're assigning the split results to scalars but not using those scalars in the map block, which seems a bit, well, odd. What's up with that?
As for the "last result" idea, foreach (which is spelled "for" by all good monks) will often serve the purpose of avoiding duplicate expressions:
$_ and return $_ for $a_parts[$_] <=> $b_parts[$_];
I've also run into odd restrictions on no strict and I really wish I understood what was broken by accident and what on purpose WRT that.
Finally, I'll take off a fractional style point for using a map block where you really meant foreach....
-- Chip Salzenberg, Free-Floating Agent of Chaos
In Section Seekers of Perl Wisdom