Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re: Comparison result capture???
by chip
|
|