in reply to
Which one is best for optimization
See
Perl.com: Optimizing Your Perl
. "Best" can vary by input, easiest to just test it, but 2 definitively uses more memory :)
Comment on
Re: Which one is best for optimization
In Section
Seekers of Perl Wisdom