|
|
| There's more than one way to do things | |
| PerlMonks |
Re: Re: Using $_ as a temp var, especially in functionsby converter (Priest) |
| on Oct 23, 2002 at 04:24 UTC ( #207293=note: print w/ replies, xml ) | Need Help?? |
|
Localizing the default pattern-matching space ($_) can make subroutines that perform several pattern-matching or other string operations against the same variable a lot quicker to write and easier to read and maintain. I'd rather write: than:
Am I being lazy? Yeah, that's part of it, but it's exactly that sort of idiom (if that even qualifies as idiomatic) that I expect to see in Perl code.
In Section
Meditations
|
|
||||||||||||||||||||||