ARGV-Abs
view release on metacpan or search on metacpan
lib/ARGV/Abs.pm view on Meta::CPAN
use warnings;
package ARGV::Abs;
{
$ARGV::Abs::VERSION = '1.01';
}
use File::Spec;
sub import
{
# Base directory for resolving paths
my $base = $_[1];
unless (defined $base) {
require Cwd;
$base = Cwd::getcwd();
}
@ARGV = map { File::Spec->rel2abs($_, $base) } @ARGV;
}
t/00-compile.t view on Meta::CPAN
use Test::More;
use File::Find;
use File::Temp qw{ tempdir };
my @modules;
find(
sub {
return if $File::Find::name !~ /\.pm\z/;
my $found = $File::Find::name;
$found =~ s{^lib/}{};
$found =~ s{[/\\]}{::}g;
$found =~ s/\.pm$//;
# nothing to skip
push @modules, $found;
},
'lib',
);
sub _find_scripts {
my $dir = shift @_;
my @found_scripts = ();
find(
sub {
return unless -f;
my $found = $File::Find::name;
# nothing to skip
open my $FH, '<', $_ or do {
note( "Unable to open $found in ( $! ), skipping" );
return;
};
my $shebang = <$FH>;
return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
push @found_scripts, $found;
( run in 0.279 second using v1.01-cache-2.11-cpan-4d50c553e7e )