No such thing as a small change | |
PerlMonks |
Re: returning scalar context from map or grepby broquaint (Abbot) |
on Apr 28, 2003 at 13:10 UTC ( [id://253670]=note: print w/replies, xml ) | Need Help?? |
Is there a way to turn the list context returned by map and grep into a scalar context?Yes, by forcing scalar context or using the scalar() function, but seeing as how that's not what you want, an array slice will just have to do See. perldata for more info on slicing. HTH
_________
In Section
Seekers of Perl Wisdom
|
|