Also common would be to centralize and use modules instead of cascading scripts.
If you are set on multiple scripts, you can use globals (our) combined with do (or require) rather than system. But this is probably not a good idea for new code, since this gets messy fast, and the execution environments can have odd effects on each other.
#!/usr/bin/perl -w use strict; our $x = 1; require 'script2.pl'; print $x;
#!/usr/bin/perl -w use strict; our $x = 2;
SuicideJunkie's suggestions are where you should look first (maybe even w/ a fork and exec); however, if you are dealing with legacy, this might help.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: Communication between scripts
by kennethk
in thread Communication between scripts
by glemley8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |