It doesn't work this way. In the master script you define your variables, however you run another perl script via system. It knows nothing about the variables in the master script. Consider the following example: master.pl
#!/usr/bin/perl use strict; use warnings; my $secret = 'BruceWayneisBatman'; my @cmd = ('perl', 'child.pl', $secret); system(@cmd) == 0 or die "system @cmd failed: $?";
child.pl
#!/usr/bin/perl use strict; use warnings; my $message = $ARGV[0]; print "The master script passed: $message\n";
Again see system.
In reply to Re^3: How to pass file paths in a master script which is used to run several perl scripts?
by marto
in thread How to pass file paths in a master script which is used to run several perl scripts?
by ankit.tayal560
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |