in reply to Call perl script from within another perl script
To call/invoke/run a Perl script from another Perl script you can also do something like:
# call_another_script.pl use strict; use warnings; do { local @ARGV; @ARGV = ("Hello", "World!"); eval { require "script_to_call.pl" }; }; print "\nOriginal args:\n"; for my $arg (@ARGV) { print "$arg\n"; }
# script_to_cal.pl use strict; use warnings; print "script_to_call.pl args:\n"; for my $arg (@ARGV) { print "$arg\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Call perl script from within another perl script
by charithd (Acolyte) on Sep 25, 2012 at 06:17 UTC | |
by dHarry (Abbot) on Sep 25, 2012 at 11:33 UTC | |
by charithd (Acolyte) on Sep 26, 2012 at 03:59 UTC |