[Chicago-talk] faster -h
JT Smith
jt at plainblack.com
Sat May 7 08:40:54 PDT 2005
It seems like one way around it would be to either do an eval{} wrapped in an if around
your use statements :
eval {"use MyBigModule"} unless $onlyDoingUsage;
Or you could use require to do the same thing:
require MyBigModule unless $onlyDoingUsage;
On Sat, 07 May 2005 05:38:24 -0500
Whitney Jackson <whjackson at gmail.com> wrote:
>
> So I have this Perl program that uses some hefty modules and as a result
> it takes a second or two just to get going. Most of the time I don't
> care because it's relatively long running and the loading time isn't
> noticeable. However, it's annoying to have to wait when I just want
> usage information. So I'm wondering if there's some way to do the
> GetOptions stuff up front and then avoid the "use SuchAndSuch;" when I
> find a -h or usage violation.
>
> Any ideas?
>
> Just to make things a bit more concrete:
>
> $ ./pctrl -h
>
> with all the modules: 2.105 seconds
> with a minimal set of modules: 0.318 seconds
>
> Whitney
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
JT ~ Plain Black
ph: 703-286-2525 ext. 810
fax: 312-264-5382
http://www.plainblack.com
Create like a god, command like a king, work like a slave.
More information about the Chicago-talk
mailing list