Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: calling module with empty import

by gaal (Parson)
on May 17, 2007 at 07:25 UTC ( [id://615945]=note: print w/replies, xml ) Need Help??


in reply to calling module with empty import

Export/import happens in Perl by convention: "use Module" calls Module::import, which typically does some initialization and places symbols in the caller's namespace.

It's recommended that module authors not export things by default, but some modules don't follow that recommendation. For example, YAML exports Dump and Load. What if your code already defines subs with those names? You still want to be able to use YAML's functions, e.g. by saying YAML::Dump($obj), but you don't want the default import. So you "import" (), and YAML::import never gets called. Note that if YAML.pm had had some important initialization it only did in its import sub, that would be missed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found