-----8<------
system("script") is not my solution, because the script is executed in 
a subshell, and his environment variables are lost after return to perl
-----8<------

Not sure what you mean by localcontext (sic). However if you want
environment variables updated by your Perl code to be visible to the
calling xterm then you can bluff things by doing a waitpid:-

88> cat waitpid.pl 
#!/usr/bin/perl

use strict;
use warnings;

$ENV{P} = "Hello World" ;

print "\nEnvironment Variable P = $ENV{P}\n\n" ;

print "In this shell type \'echo \$P\'\n" ;
my $pid = system("$ENV{SHELL}") ;
waitpid($pid,0) ;

print "\n$0 is now complete\n AND PID = $pid\n" ;
89> waitpid.pl 

Environment Variable P = Hello World

In this shell type 'echo $P'
[EMAIL PROTECTED] 81> echo $P
Hello World
[EMAIL PROTECTED] 82>

Couple of things to note: the print $0 doesn't print, and the prompt
line numbers get offset.

Cheers,

Just in

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to