Skip to content

Instantly share code, notes, and snippets.

@wchristian
Created March 30, 2011 12:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wchristian/894331 to your computer and use it in GitHub Desktop.
Save wchristian/894331 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
my $addthis = "x" x 5000;
if ( !@ARGV ) {
for ( 1 .. 1000 ) {
$ENV{PERL5LIB} .= ";$addthis";
my @incs = `perl $0 check`;
die "\nchild died with fatal error" if $?;
print $incs[0];
die "\nchild started ignoring PERL5LIB" if $incs[1] <= scalar @INC;
}
}
else {
print "\$ENV{PERL5LIB} is " . length( $ENV{PERL5LIB} ) . " bytes long and ";
print "\@INC contains " . scalar @INC . " entries\n";
print scalar @INC;
}
__END__
##################### WIN 7 ####################################################
D:\My Dropbox\Public\reports>perl env-test.pl
$ENV{PERL5LIB} is 5001 bytes long and @INC contains 4 entries
$ENV{PERL5LIB} is 10002 bytes long and @INC contains 5 entries
$ENV{PERL5LIB} is 15003 bytes long and @INC contains 6 entries
$ENV{PERL5LIB} is 20004 bytes long and @INC contains 7 entries
$ENV{PERL5LIB} is 25005 bytes long and @INC contains 8 entries
$ENV{PERL5LIB} is 30006 bytes long and @INC contains 9 entries
$ENV{PERL5LIB} is 35007 bytes long and @INC contains 3 entries
child started ignoring PERL5LIB at env-test.pl line 12.
D:\My Dropbox\Public\reports>
##################### WIN XP ###################################################
D:\My Dropbox\Public\reports>perl env-test.pl
$ENV{PERL5LIB} is 5001 bytes long and @INC contains 4 entries
$ENV{PERL5LIB} is 10002 bytes long and @INC contains 5 entries
$ENV{PERL5LIB} is 15003 bytes long and @INC contains 6 entries
$ENV{PERL5LIB} is 20004 bytes long and @INC contains 7 entries
$ENV{PERL5LIB} is 25005 bytes long and @INC contains 8 entries
child died with fatal error at env-test.pl line 10.
D:\My Dropbox\Public\reports>
##################### LINUX ####################################################
[root@data-stats ~]# perl env-test.pl
$ENV{PERL5LIB} is 5001 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 10002 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 15003 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 20004 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 25005 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 30006 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 35007 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 40008 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 45009 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 50010 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 55011 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 60012 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 65013 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 70014 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 75015 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 80016 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 85017 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 90018 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 95019 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 100020 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 105021 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 110022 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 115023 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 120024 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 125025 bytes long and @INC contains 13 entries
$ENV{PERL5LIB} is 130026 bytes long and @INC contains 13 entries
Can't exec "perl": Argument list too long at env-test.pl line 9.
child died with fatal error at env-test.pl line 10.
[root@data-stats ~]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment