in reply to Re: do script2.pl with parms
in thread do script2.pl with parms

Add a (scope-limiting) block and local to that and @ARGV won't be damaged in script 1:

# in script 1 { local @ARGV=(...); do('script2'); }

But this is just an awful kludge.

tel2, move (most of) the code of script 2 into a module. use that module in script 2 to get the existing behaviour. use that module also in script 1 to get the functions you need.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: do script2.pl with parms
by GrandFather (Saint) on Nov 12, 2010 at 22:02 UTC

    A sometimes used technique is to use caller to distinguish between command line invocation as a script and use as a module:

    package DualUseScript; ... return 1 if caller; # script "main" code
    True laziness is hard work