BrowserUk:
Thanks, that's the sort of thing I was hoping to find. I've never really felt comfortable with those globref things, so it never occurred to me to try using one. That prompted me to read perlop and perlref and learn a bit more about them.
Now I can clean up my latest text munger and move on to the next item on my TODO list.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
. I've never really felt comfortable with those globref things,
You're welcome. Now I'm gonna rant, but not at you, so feel free to turn away now :)
This is a trivial example of why I feel so strongly that the vogue for eschewing whole lumps of Perl's capabilities are self defeating.
The laudable stated intent is to simplify the learning process for new Perlers. The problem is that each time you omit some subsection of perl's vocabulary from a Perler's education, you end up forcing them to jump through hoops to solve the very problems that subsection of the vocabulary was added to the language to deal with.
Globrefs: *STDIN, *STDOUT, *STDERR, *DATA, *ARGV, all remain a vital, irreplaceable part of the Perl programmers everyday vocabulary. And sweeping globrefs under the carpet to hide them from newbies does no one any favours. File handles are "global references". The fact that OO-dogma rejects anything "global", and that we can now use lexical aliases to them with some nice to have side effects, doesn't change that.
Trying to code effectively in Perl without mentioning globrefs is like trying to have everyday conversation without all the words that some would censor with victoriana zeal. Possible, but so stilted as to make it less enjoyable and much harder than it need be.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |