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

Re: Re: use and performance

by educated_foo (Vicar)
on Jun 10, 2003 at 15:25 UTC ( [id://264722]=note: print w/replies, xml ) Need Help??


in reply to Re: use and performance
in thread use and performance

This isn't entirely true, since all those imports can really kill your script's startup time. If startup time's an issue, you should "use" modules only once, and just "require" them everywhere else. Equally good documentation, but less pain.

/s

Replies are listed 'Best First'.
Re: Re: Re: use and performance
by perrin (Chancellor) on Jun 10, 2003 at 15:36 UTC
    I shudder to think how many imports it would take to make a dent in the startup time of a script on a modern computer. Most imports don't do anything at all.
      Class::Struct is an example of something that does a lot of work on import. This bites the prototype perl6 compiler pretty hard.

      /s

        Are you talking about this kind of usage?

        use Class::Struct CLASS_NAME => [ ELEMENT_NAME => ELEMENT_TYPE, ... ];
        You can't skip that call to import, or your struct class would not get created.

        Anyway, if you don't want to import anything you can just call use with an empty list. This is common in mod_perl:

        use CGI ();

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found