App-plx
view release on metacpan or search on metacpan
bin/plx-packed view on Meta::CPAN
This module provides (among other things) a C<can_run> function, which is
similar to C<which>. It is a much heavier module since it does a lot more,
and if you use C<can_run> it pulls in L<ExtUtils::MakeMaker>. This combination
may be overkill for applications which do not need L<IPC::Cmd>'s complicated
interface for running programs, or do not need the memory overhead required
for installing Perl modules.
At least some older versions will find executables in the current directory,
even if the current directory is not in the search path (which is the default
on modern Unix).
C<can_run> converts directory path name to the 8.3 version on Windows using
C<Win32::GetShortPathName> in some cases. This is frequently useful for tools
that just need to run something using C<system> in scalar mode, but may be
inconvenient for tools like L<App::pwhich> where user readability is a premium.
Relying on C<Win32::GetShortPathName> to produce filenames without spaces
is problematic, as 8.3 filenames can be turned off with tweaks to the
registry (see L<https://technet.microsoft.com/en-us/library/cc959352.aspx>).
=item L<Devel::CheckBin>
This module purports to "check that a command is available", but does not
provide any documentation on how you might use it.
=back
=head1 AUTHORS
=over 4
=item *
Per Einar Ellefsen <pereinar@cpan.org>
=item *
Adam Kennedy <adamk@cpan.org>
=item *
Graham Ollis <plicease@cpan.org>
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2002 by Per Einar Ellefsen <pereinar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
FILE_WHICH
$fatpacked{"local/lib.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'LOCAL_LIB';
package local::lib;
use 5.006;
BEGIN {
if ($ENV{RELEASE_TESTING}) {
require strict;
strict->import;
require warnings;
warnings->import;
}
}
use Config ();
our $VERSION = '2.000024';
$VERSION = eval $VERSION;
BEGIN {
*_WIN32 = ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'symbian')
? sub(){1} : sub(){0};
# punt on these systems
*_USE_FSPEC = ($^O eq 'MacOS' || $^O eq 'VMS' || $INC{'File/Spec.pm'})
? sub(){1} : sub(){0};
}
my $_archname = $Config::Config{archname};
my $_version = $Config::Config{version};
my @_inc_version_list = reverse split / /, $Config::Config{inc_version_list};
my $_path_sep = $Config::Config{path_sep};
our $_DIR_JOIN = _WIN32 ? '\\' : '/';
our $_DIR_SPLIT = (_WIN32 || $^O eq 'cygwin') ? qr{[\\/]}
: qr{/};
our $_ROOT = _WIN32 ? do {
my $UNC = qr{[\\/]{2}[^\\/]+[\\/][^\\/]+};
qr{^(?:$UNC|[A-Za-z]:|)$_DIR_SPLIT};
} : qr{^/};
our $_PERL;
sub _perl {
if (!$_PERL) {
# untaint and validate
($_PERL, my $exe) = $^X =~ /((?:.*$_DIR_SPLIT)?(.+))/;
$_PERL = 'perl'
if $exe !~ /perl/;
if (_is_abs($_PERL)) {
}
elsif (-x $Config::Config{perlpath}) {
$_PERL = $Config::Config{perlpath};
}
elsif ($_PERL =~ $_DIR_SPLIT && -x $_PERL) {
$_PERL = _rel2abs($_PERL);
}
else {
($_PERL) =
map { /(.*)/ }
grep { -x $_ }
map { ($_, _WIN32 ? ("$_.exe") : ()) }
map { join($_DIR_JOIN, $_, $_PERL) }
split /\Q$_path_sep\E/, $ENV{PATH};
}
}
$_PERL;
}
sub _cwd {
if (my $cwd
= defined &Cwd::sys_cwd ? \&Cwd::sys_cwd
: defined &Cwd::cwd ? \&Cwd::cwd
( run in 0.468 second using v1.01-cache-2.11-cpan-e93a5daba3e )