in reply to Re^3: "$_" vs. $_
in thread "$_" vs. $_

Thank you for your point regarding unnecessary localization of $1 and $2. Still, my point was avoiding intermediate (possibly unnecessary?) variables, i.e. $addr and $group in your code that incredibly looks very much like my original!

Ultimately, I guess it is style. One thing I love about Perl is TIMTOWTDI and I admit I tend to go for minimal keyboard presses unless extra performance is needed. Then, I would probably lean to doing it in C++.

Update: Incidentally, the named approach is probably a little faster than a localised one. However, only slightly!

Replies are listed 'Best First'.
Re^5: "$_" vs. $_
by ikegami (Patriarch) on Apr 08, 2007 at 15:39 UTC

    Still, my point was avoiding intermediate (possibly unnecessary?) variables,

    I did not add any new variables. You used two (both named $_) and so did I. My point was that naming two variables $_ is more confusing, less readable and less maintainable.