[Israel.pm] typeglobs

Amir E. Aharoni amir.aharoni at gmail.com
Wed Jun 27 05:16:56 PDT 2007


> Can you elaborate? Why is opening into a scalar better than opening into
> a file handle?

It is also mentioned in the chapter about IO in Damian's Perl Best
Practices (the Dog book.)

A lot of people still use it, because that's what all editions of the
Camel and Llama books say.

perlfunc and perlopentut give the filehandle way first and then
describe the scalar way in a bit confusing manner.

I have used Perl 5.6 for a long time wishing that i could use a scalar
as a filehandle before realizing that i can do it only when i read PBP
in 2006.

I did find typeglobs useful for a very few cases when using them to
play with variable scope improved readability.



More information about the Perl mailing list