Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Module usage

by ww (Archbishop)
on Feb 26, 2009 at 04:07 UTC ( [id://746447]=note: print w/replies, xml ) Need Help??


in reply to Module usage

That module MAY export some functions, etc. by default, which action you can override with the empty parentheses. (You may find jasonk's statement clearer) But note, you will have access to those when your code includes use MyModule; and subsequently specifies some particular exportable therefrom.

So, if you wish to make use of some exportable function from a module when (and only when) a particular condition in your code is reached (think "dispatch table", for example) but another exportable function if a different condition is reached, you might find the empty parentheses useage handy (when followed by the likes of MyModule -> new in a dispatch table (or elsewhere).

Some other references you may find helpful:
  • perldoc perlmod
  • The Tutorials here, under the heading "Modules: How to Create, Install, and Use"
  • Printed discussions such as those in "Intermediate Perl"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-25 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found