建立一个a.pl
#!/usr/bin/perl -w
use strict;
my $a = 'China';
$ENV{'country'} = $a;
exec("perl b.pl");
#system("perl b.pl");
print "KKKKKK\n";
建立一个b.pl
#!/usr/bin/perl -w
use strict;
print "$ENV{'country'}\n";
运行: perl a.pl
建立一个a.pl
#!/usr/bin/perl -w
use strict;
my $a = 'China';
$ENV{'country'} = $a;
exec("perl b.pl");
#system("perl b.pl");
print "KKKKKK\n";
建立一个b.pl
#!/usr/bin/perl -w
use strict;
print "$ENV{'country'}\n";
运行: perl a.pl