Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Can I force strictness on included files?

by broquaint (Abbot)
on Jun 30, 2005 at 08:59 UTC ( #471254=note: print w/replies, xml ) Need Help??


in reply to Can I force strictness on included files?

If you're not adverse to a little module usage then Module::Locate can help you out:
use Module::Locate 'get_source'; sub use_mod_strictly { my $mod = shift; my $ret = eval "use strict; " . get_source($mod); die $@ if $@; return $ret; }
So this will grab the source of $mod (and populate %INC), add strictness to the source and finally evaluate the new strict source, checking eval for errors too.
HTH

_________
broquaint

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://471254]
help
Chatterbox?
[LanX]: obscure facts: only naturally born monks can become president here!
[cbeckley]: I have a functioning module I use to spawn sets of commands across multiple servers.
[cbeckley]: It's nascent, and probably looks like baby Perl to the veterans.
[cbeckley]: I have several questions about it's future development. But it seems like a lot of code to put in a sopw.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2017-03-24 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (304 votes). Check out past polls.