PerlPowerTools

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN


If you want to install them somewhere else, run the F<Makefile.PL>
with your installation location:

    % perl Makefile.PL INSTALL_BASE=/where/you/want/them/to/go

But, this F<Makefile.PL> is more interesting than that. You can load
it with C<require> and call C<arguments> to get the data structure it
passes to C<WriteMakefile>:

	my $package = require '/path/to/Makefile.PL';
	my $arguments = $package->arguments;

Note that C<require>-ing a file makes an entry in C<%INC> for exactly
that name. If you try to C<require> another file with the same name,
even from a different path, C<require> thinks it has already loaded
the file. As such, I recommend you always require the full path to the
file.

The return value of the C<require> is a package name (in this case,
the name of the main module). Use that to call the C<arguments> method.

t/rm/process_options.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More;

my $class = require './bin/rm';

is( $class, 'PerlPowerTools::rm' );

subtest preprocess_options => sub {
	my $method = 'preprocess_options';
	can_ok $class, 'new', 'options', $method;

	my @table = (
		[ [ qw(a b c        ) ],  [ qw( a b c        ) ] ],
		[ [ qw(-- a b c     ) ],  [ qw(-- a b c      ) ] ],

t/rm/run.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More;

use File::Temp;
my $class = require './bin/rm';
is( $class, 'PerlPowerTools::rm' );


my $dir = File::Temp::tempdir( CLEANUP => 1 );
chdir $dir or BAIL_OUT( "Could not change to $dir: $!" );

my $EXIT;
BEGIN {
	*CORE::GLOBAL::exit = sub { $EXIT = $_[0] };
	}

t/units/units.t  view on Meta::CPAN

# units.t - test for script units

use strict;
use warnings;

use Test::More;

run_tests();

sub run_tests {
    my $class = require './bin/units';

	subtest sanity => sub {
		can_ok $class, 'test'
	};

	my @tables = (
		calendar_table(),
		distance_table(),
		volume_table(),
	);



( run in 0.287 second using v1.01-cache-2.11-cpan-0d8aa00de5b )