App-Staticperl
view release on metacpan or search on metacpan
bin/staticperl view on Meta::CPAN
@ARGV
or die "$0: use 'staticperl help' (or read the sources of staticperl)\n";
# remove "." from @INC - staticperl.sh does it for us, but be on the safe side
BEGIN { @INC = grep !/^\.$/, @INC }
$|=1;
our ($TRACER_W, $TRACER_R);
sub find_incdir($) {
for (@INC) {
next if ref;
return $_ if -e "$_/$_[0]";
}
undef
}
sub find_inc($) {
my $dir = find_incdir $_[0];
return "$dir/$_[0]"
if defined $dir;
undef
}
BEGIN {
# create a loader process to detect @INC requests before we load any modules
bin/staticperl view on Meta::CPAN
close $TRACER_R;
}
#############################################################################
# now we can use modules
use common::sense;
use Config;
use Digest::MD5;
sub cache($$$) {
my ($variant, $src, $filter) = @_;
if (length $CACHE and 2048 <= length $src and defined $variant) {
my $file = "$CACHE/" . Digest::MD5::md5_hex "$CACHEVER\x00$variant\x00$src";
if (open my $fh, "<:raw:perlio", $file) {
print "using cache for $file\n"
if $VERBOSE >= 7;
local $/;
@ARGV
or die "$0: use 'staticperl help' (or read the sources of staticperl)\n";
# remove "." from @INC - staticperl.sh does it for us, but be on the safe side
BEGIN { @INC = grep !/^\.$/, @INC }
$|=1;
our ($TRACER_W, $TRACER_R);
sub find_incdir($) {
for (@INC) {
next if ref;
return $_ if -e "$_/$_[0]";
}
undef
}
sub find_inc($) {
my $dir = find_incdir $_[0];
return "$dir/$_[0]"
if defined $dir;
undef
}
BEGIN {
# create a loader process to detect @INC requests before we load any modules
close $TRACER_R;
}
#############################################################################
# now we can use modules
use common::sense;
use Config;
use Digest::MD5;
sub cache($$$) {
my ($variant, $src, $filter) = @_;
if (length $CACHE and 2048 <= length $src and defined $variant) {
my $file = "$CACHE/" . Digest::MD5::md5_hex "$CACHEVER\x00$variant\x00$src";
if (open my $fh, "<:raw:perlio", $file) {
print "using cache for $file\n"
if $VERBOSE >= 7;
local $/;
( run in 0.540 second using v1.01-cache-2.11-cpan-65fba6d93b7 )