[ABE.pm] Text::Template Q

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Wed Jul 26 13:06:39 PDT 2006


* "Faber J. Fedor" <faber at linuxnj.com> [2006-07-26T14:39:34]
> And today was that day; when I switch to the new (?) style, T::T worked
> perfectly.
> 
> So WTF is the difference between the two styles?

  open FOO, "<filename";

I believe this is accurate: The above opens the file in read mode and puts the
opened filehandle in the IO typeglob entry of the FOO typeglob in the current
package.  In other words, it puts the fh in *FOO{IO}.

It used to be harder to get at parts of a glob, so people would pass around
references to a typeglob instead of a reference to the filehandle part of the
glob.  Then code would say, "Aha!  A typeglob!  Since a typeglob is stupid to
pass as a parameter, he must be passing it in so that I can use its
filehandle!"

Since 5.6, you can say "open $x" where $x is undef, and $x will be assigned a
new anonymous filehandle reference.

T::T's documentation did clearly requst a fh reference, not a typeglob
reference.

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060726/297124c5/attachment.bin 


More information about the ABE-pm mailing list