On 10 Jul 2001 20:24:45 +0200, P. Schaub wrote:
> Hi List,
> 
> I am calling a perl script within another perl script.
> What is the best way to pass arguments to the second one ?
> Is it possible to pass arrays and hashs (or at least refs) ?
> So far I am calling the second script like
> @result=`script2.pl $arg1 $arg2 $arg3`
> but I guess this is quite ugly.
> 
> any help welcome
> 
<snip />
Well, backticks do variable interpolation (and hence array
interpolation) so you could say:

@result=`script2.pl @ARGV`;

Be careful with this though, if individual elements of the array have
spaces then they will be treated as seperate options in script2.pl.

 



--
Today is Sweetmorn, the 45th day of Confusion in the YOLD 3167
Hail Eris!


Reply via email to