in reply to Local Typeglob
G'day zergoid,
Welcome to the monastery.
Firstly, there have been a number of editions of "Programming Perl". I own the first three: that code doesn't appear on page 86 of any of those. [Note: This is true for many Perl books. Providing more information than just the title is usually very useful and will generally get a faster (and better) answer.]
The code you've posted is almost identical to that in "perldata: Typeglobs and Filehandles". That documentation explains typeglobs, the code returning *FH and code (sub myopen {...}) to do this using a lexical (my) variable. It also contains links to further, related information.
I'd suggest checking if your book also has similar, additional information (e.g. a myopen() routine). Even if it doesn't, the documentation I've linked to may answer your question or, at least, provide enough for more specific/focussed questions on some particular aspect of typeglobs.
-- Ken
|
|---|