This depends on whether the bash script is being executed by script1.pl, or by some other parent process which runs script1.pl, waits for it to complete, then runs the bash script. In the first case, simply pass the value in the command line like I did in my example, and then do the same from within your bash script. In the latter case, script1.pl would need to return the value to its parent process, which would then pass the value to the bash script.
I think it's very likely that the best solution would be to redo the whole thing as a single Perl script. However, if you already have two Perl scripts and you're just hoping to pass a value from one to the next without making any other changes, use my example, except stick chdir "directory"; at the beginning of script2.pl. That will eliminate the need for a bash script sitting between the two.
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re^5: Use a Variable in a Separate Perl Script
by aaron_baugher
in thread Use a Variable in a Separate Perl Script
by NinjaOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |