Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))

by almr (Sexton)
on Jan 06, 2023 at 23:08 UTC ( [id://11149395]=note: print w/replies, xml ) Need Help??


in reply to Re^3: slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))
in thread slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))

Ah. Then why not use Pod::Usage if $needPod;

Replies are listed 'Best First'.
Re^5: slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))
by LanX (Saint) on Jan 07, 2023 at 02:46 UTC
    > use Pod::Usage if $needPod;

    Timing! You can't make a compile-time use (the BEGIN-part) depend on run-time conditions.

    FWIW: you could use the if pragma, but only if the condition is available at compile-time

      Because use takes effect at compile time, it doesn't respect the ordinary flow control of the code being compiled. In particular, putting a use inside the false branch of a conditional doesn't prevent it from being processed. If a module or pragma only needs to be loaded conditionally, this can be done using the if pragma:

      use if $] < 5.008, "utf8"; use if WANT_WARNINGS, warnings => qw(all);

    but as you see the conditions here are (compile time) constants

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

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

    No recent polls found