Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This is essentially the same answer as others have provided but if you don't understand their answers perhaps this manner of expressing them will help...

'use Mymodule ();' causes Mymodule to be loaded without calling its import() subroutine. This makes the subroutines of the module available and will cause BEGIN, UNITCHECK, CHECK and INIT blocks to be executed if they exist.

The import() subroutine of many (not all) modules will add variables or subroutines to the callers name space.

You sometimes want to load the module but do not want it to add anything to your name space. For example - you may have your own subroutines of the same name as the module would create (import) if its import() subroutine was called.

Having loaded the module, you can access its subroutines using fully qualified subroutine or method calls. For example, Mymodule::some_subroutine() or Mymodule->some_method.

In some modules the import() subroutine does other things as well as or instead of importing names into the callers name space. If the module is doing initialization in its import() subroutine, then it may not work as expected when you prevent the subroutine being called. You should read the documentation or the code of the module you are using to be sure.


In reply to Re: Module usage by ig
in thread Module usage by vinoth.ree

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found