jujiro_eb has asked for the wisdom of the Perl Monks concerning the following question:
Need your help again. Is it possible to launch dynamically generated perl statements from within a script, which reference the variables of the parent script? In other words, execute the generated statements without invoking another copy of the interpreter.
For example:
I have the parent script as following:
#! /usr/bin/perl use strict; # Example of launching a perl script from within another script my $v1="Hello"; my $v2="There"; # I do know that the following statement will not produce the desired +result. system ("perl launch_child.pl");
Dynamically generated child script, launch_child.pl looks like this:
print "$v1\n"; print "$v2\n";
Thanks.
Ash
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help: Launch generated perl statements from a perl script
by almut (Canon) on Apr 17, 2009 at 21:31 UTC | |
|
Re: Help: Launch generated perl statements from a perl script
by morgon (Priest) on Apr 17, 2009 at 21:38 UTC |