Perl does not require anyone to remember the list of functions that use $_ as a default any more than C requires one to remember the list of functions that take a file number as an argument. These things are very well documented. I used split successfully for years without knowing what its default arguments were, and if I'd ever seen it in foreign code (probably where I learned it, in fact), it's clearly documented.
| [reply] [d/l] |
Actually, you need to remember only those few functions that put information in $_ (like map, grep, foreach, commandline -n etc); not those lots of functions that _optionally_ default on $_ (like print, split, m//, sin, unlink) because for these you can just always use these with an explicit argument.
| [reply] |
Its certainly your opinion, and not of several other extremely good perl programmers.
print foreach @list_of_items
is quite an concise and more readable than most other code i've seen that does the same thing. Like the blog says, its up to you to use it wisely, use it enhance your code or use it make your code look like a junkie on meth. Up to you, really. | [reply] [d/l] |