in reply to Keeping variable persistent
One option might be to pass the variables as command-line parameters.
test_q.pltest_r.pl#! /usr/bin/perl use strict ; use warnings ; $|++ ; my $arg_one = 'foo' ; my $arg_two = 'bar' ; my $arg_three = 'zoot' ; system 'perl', './test_r.pl', $arg_one, $arg_two, $arg_three ; exit ; __END__
#! /usr/bin/perl use strict ; use warnings ; $|++ ; my ( $arg_one, $arg_two, $arg_three ) = @ARGV ; print "Arg one is $arg_one.\n" ; print "Arg two is $arg_two.\n" ; print "Arg three is $arg_three.\n" ; exit ; __END__
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
|
|---|