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

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 ...


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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2015-11-27 01:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (712 votes), past polls