Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Common sub as method or function

by akho (Hermit)
on Aug 15, 2007 at 17:06 UTC ( [id://632798]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Common sub as method or function
in thread Common sub as method or function

Oh, and also: if you only want to import a sub into main::, you should not import the whole typeglob. Also, there is probably no need to import into main::timestamp is a rather generic name that may be used in some function/module you call, and things will soon get messy. Besides, local would be pretty much useless inside a BEGIN block (and that is very desirable). Use

BEGIN { *Module::Derived::timestamp = \&Module::Base::timestamp; }

or something.

All this means that symbol table tricks should be severely incapsulated so that no living soul ever sees them Exporter.pm can help remove this mess!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://632798]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found