Hello

I am trying to start perl script from PAR
script1.pl that runs without parameters and was converted to exe

script2.pl runs with parameters and should have the same environment
as script1.pl

I cannot chande or modify script2.pl so I need use it "as is"

"system", "exec", and using of `` dont help me because they start new
process in another enviroment etc.


########### script1.pl ################
use warnings;
use strict;
my $script;

# read content of script2.pl
open(S,"script2.pl");
{local $/=undef;$script=<S>};
close S;

# feed parameters for script2.pl
@ARGV = ("-parameter1=foo","-parameter2=bar");

eval{$script};        # trying to eval content of $script
print $@ if $@;
#########################################

for test purpose script2.pl can be:

############ script2.pl ################
use sctrict;
use warnings;
foreach(@ARGV){
    print $_."\n";
}
###########################################

this dont work - (perl dont evaluate content but variable itself ?)

I get warnings "Useless use of private variable in void context at.."
and no output.

can somebody give me a hint?


thanks



-- 
Best regards,
 Pavel                            mailto:[EMAIL PROTECTED]

Reply via email to