. 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.
In reply to Re^3: Filehandle dilemma (DATA, STDIN, a file)
by BrowserUk
in thread Filehandle dilemma (DATA, STDIN, a file)
by roboticus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |