I'd call that a bug in use strict, to allow a symbolic glob ref like that. On the other hand, by the time you're playing with glob aliasing, what's a little symbolic reference between friends? :-,
-- Chip Salzenberg, Free-Floating Agent of Chaos | [reply] [d/l] |
that's no bug, Chip. print accepts a filehandle as the first parameter. filehandles can be accessed as barewords, as they are in many places, such as open FH, '>', '/dev/null' or die $!;. filehandles are either referenced as barewords, or as foo-thing syntax: *FH{IO}.
~Particle *accelerates*
| [reply] [d/l] [select] |
| [reply] [d/l] |
Thanks, that's exactly what I was looking for.
What's going on there? Is select being called in a typeglob context, and so returning a typeglob instead of a string?
| [reply] |
there is no typeglob context, but you're on to something. when you assign the result from select to a scalar, it stringifies the IO type that select normally returns. since there's no sigil for an IO type, you usually assign to it through a typeglob. since typeglobs cannot be lexical, you cannot use my to limit their scope. instead, you must use local, which will limit their scope to the current block, and create the typeglob, if it doesn't already exist.
hope that helps.
~Particle *accelerates*
| [reply] [d/l] [select] |