ToolSet yak shaving adds Perl 5.10 features

dagolden on 2008-11-07T03:05:03

As often happens, I can't remember the exact original need that started the latest round of yak shaving. I think I was working on a one-liner to prototype a test program for some small program I was writing.

In any case, I was annoyed that my XDG ToolSet module I use for one-liners didn't give me Perl 5.10 features, but adding them required a new ToolSet release.

So now "perl -MXDG -e ... " gives me strict, warnings, some of Carp, DDS, Path::Class, File::Spec, Scalar::Util and either all of the Perl 5.10 features or else at least Perl6::Say.

If anyone else finds this useful, here's the code, or clone it from git and adapt as you see fit.

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;