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

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.

Replies are listed 'Best First'.
Re: Re: Re: Re: use and performance
by educated_foo (Vicar) on Jun 11, 2003 at 03:38 UTC
    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 ();