Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: anyway to abbreviate use strict; use warnings;

by xdg (Monsignor)
on Jan 09, 2009 at 16:26 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found