Keep It Simple, Stupid | |
PerlMonks |
Re: Use of Typeglobby ikegami (Patriarch) |
on Aug 09, 2005 at 14:00 UTC ( [id://482216]=note: print w/replies, xml ) | Need Help?? |
Example one:
Example two:
Most scripts don't use typeglobs. They just reap the benefits of very special modules which use them. For example, Exporter and constant might use typeglobs to import the symbols into the caller's namespace. The top example can be rewritten without typeglobs. It's safer without them.
Note how greet didn't change? Where file handles are concerned, typeglobs, ref to typeglobs and IO::Handle objects are almost always interchangable.
In Section
Seekers of Perl Wisdom
|
|