Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Possible redundant use of "use strict" and "use warnings"?

by Perlbotics (Bishop)
on Mar 09, 2020 at 18:14 UTC ( #11114029=note: print w/replies, xml ) Need Help??


in reply to Possible redundant use of "use strict" and "use warnings"?

You can remove them. Perl remembers the modules already loaded (%INC) and does not load them again.
Take care to consolidate arguments if the modules use some (not the case here).

Replies are listed 'Best First'.
Re^2: Possible redundant use of "use strict" and "use warnings"?
by haukex (Bishop) on Mar 09, 2020 at 18:22 UTC
    Perl remembers the modules already loaded (%INC) and does not load them again.

    Yes, but to be nitpicky that's a feature of require - use is equivalent to BEGIN { require Module; Module->import( LIST ); }, meaning that multiple use statements will still cause the packages' ->import method to be called multiple times, which may make a difference if import does some nonstandard things.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-05-29 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?