Re: Calling a perl script within another

2005-03-18 Thread Jay Savage
On Fri, 18 Mar 2005 07:46:48 -0500, zentara <[EMAIL PROTECTED]> wrote: > On Thu, 17 Mar 2005 18:57:47 +0200, [EMAIL PROTECTED] (Offer Kaye) > wrote: > > >On Thu, 17 Mar 2005 11:40:10 -0500, zentara wrote: > > > >> > > >> >The above works fine , but I do not want to fork out a new perl process > >>

Re: Calling a perl script within another

2005-03-18 Thread Ramprasad A Padmanabhan
After a small change This works perfectly fine thank you all > { > $scriptname = get_scriptname($recipient) local(@_) = ($arg1,$arg2,$arg3); do($scriptname); > > $output = $global::output; > # This variable is set by the $scriptname > do_something($output); > }

Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> Well, yes, but the way you've designed this, you already run that risk. > > Now if you replaced get_scriptname() with get_subroutine(), and found a > way to abstract out the bits that are different for each $recipient, > then you could simplify things tremendously, and hopefully make your > r

Re: Calling a perl script within another

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 11:19:39 -0500, Jay Savage wrote: > >my $loopscript = $scripts{the_one_I_need} ; >my ($loadargv1, $loadargv2, $loadargv3) = ($var1, $var2, $var3) ; >$loopscript =~ s/^(.+)/[EMAIL PROTECTED] = \($loadargv1, $loadargv2, > $loadargv3\);/; >exec $loopscript ; > >

Re: Calling a perl script within another

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 11:40:10 -0500, zentara wrote: > > > >{ > > > >$script = foo(); > >$output = `perl $script $a $b $c `; > >do_someting($output); > >... > >} > > > >The above works fine , but I do not want to fork out a new perl process > >every time. Is there a way I can avoid this. I would

Re: Calling a perl script within another

2005-03-17 Thread Jay Savage
On Thu, 17 Mar 2005 09:32:43 -0500 (EST), Chris Devers <[EMAIL PROTECTED]> wrote: > On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > > > Okay, so we're back to my other suggestion -- "require" it: > > > > > > { > > > $script = get_name_of_script(); # names matter! pick good ones

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > Okay, so we're back to my other suggestion -- "require" it: > > > > { > > $script = get_name_of_script(); # names matter! pick good ones! > > $output = require $script or > > die "Couldn't 'require' $script\n$

Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> Okay, so we're back to my other suggestion -- "require" it: > > { > $script = get_name_of_script(); # names matter! pick good ones! > $output = require $script or > die "Couldn't 'require' $script\n$!\n"; > do_something($output); > } > No I cant use

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > If the code for $script is being generated by the foo() subroutine, then > > why are you not just eval()ing on the spot? > > > > { > > $script = foo(); > > $output = eval{ $script } or > > die "Couldn't eval

Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> If the code for $script is being generated by the foo() subroutine, then > why are you not just eval()ing on the spot? > > { > $script = foo(); > $output = eval{ $script } or > die "Couldn't eval code: $script\n$!\n"; > do_something($output); > } I

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > I have a requirement to call a perl script within another and take > the output Okay. The typical way to do this would be to make a module out of it, or at least a "require" call, but it looks like you may be generating the code dynamic

Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
Hi all, I have a requirement to call a perl script within another and take the output for example { $script = foo(); $output = `perl $script $a $b $c `; do_someting($output); ... } The above works fine , but I do not want to fork out a new perl process every time. Is there a way I can