Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: anyway to abbreviate use strict; use warnings;

by xdg (Monsignor)
on Jan 09, 2009 at 16:26 UTC ( #735232=note: print w/ replies, xml ) Need Help??


in reply to anyway to abbreviate use strict; use warnings;

You can create a module to do that with ToolSet. See ToolSet::SWC as an example.

Personally, I created a module I call "XDG" like this:

package XDG; our $VERSION = '0.05'; use base 'ToolSet'; ToolSet->use_pragma( 'strict' ); ToolSet->use_pragma( 'warnings' ); ToolSet->export( 'Carp' => 'carp croak confess', 'Data::Dump::Streamer' => 'Dump', 'File::Spec' => undef, 'Path::Class' => 'file dir', 'Scalar::Util' => 'refaddr reftype blessed', ); if ( $] >= 5.010 ) { ToolSet->use_pragma( 'feature', ':5.10' ); } else { ToolSet->export( 'Perl6::Say' => 'say' ); } 1; # true

That's handy for one-liners, too:

$ perl -MXDG -e ...

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re: anyway to abbreviate use strict; use warnings;
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-22 02:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls