Ask a Question related to PERL Beginners, Design and Development.
-
Ramprasad A Padmanabhan #1
call one perl script within another
How Can I call a perl script within my main script
If I do
$response=`perl $somescript $args`;
This will call a new perl process, and may be more expensive on the
system. On the other hand I can do
do "$somescript $args";
But How do I get the reponse of the script.
Is there a way or should I just use the backticks
Thanks
Ram
Ramprasad A Padmanabhan Guest
-
PLJava - Perl embeded into Java (calling Perl from Java) - 1sr release - call for tests and review, please.
Recently on perlmonks.com I have posted a prototype of Perl embeded into Java (#372197="Embeding Perl into Java to use CPAN modules directly from... -
How can I call MFC functions from Perl
Hello, How can I call MFC functions from Perl? Which module / method I should select? Inline:C ? Inline:CPP ? XS ? or SWIG? Regards, Sankaran -
call win32 API from linux perl script
Hi, I'm must calling an API from a remote win32 server in a perl script. On a windows server, I use win32::OLE and it's work fine ! But my... -
Control a non-perl image viewer from perl script
Below is a (non-finished) script that trys to run a linux viewer called eog (eye of gnome) in a script that will eventually allow me to power thru... -
Execute shell script from a perl script
Hi, How can I executed a Unix shell script from a Perl script. The shell script is a dump of a oracle table to a file. The perl script is for... -
Andrew Shitov #2
Re: call one perl script within another
> This will call a new perl process, and may be more expensive on the
<...>> system. On the other hand I can doProbably the simpliest way is to make called script a module and run it> But How do I get the reponse of the script.
using either 'use' or 'require'.
Andrew Shitov Guest
-
Ramprasad A Padmanabhan #3
Re: call one perl script within another
Andrew Shitov wrote:
Precisely , But That is something I cannot do because the script is in a>>> This will call a new perl process, and may be more expensive on the
>> system. On the other hand I can do
> <...>
>>>> But How do I get the reponse of the script.
>
> Probably the simpliest way is to make called script a module and run it
> using either 'use' or 'require'.
>
file which is written on the fly by the client end settings.
Ideally it should have been such a way that The client settings are
written into a configuration file and the program reads the
configuraton file and runs the condition.
The point over here is , Is it possible to use the existing instance of
perl running main to run the child program and return the output
THanks
Ram
Ramprasad A Padmanabhan Guest
-
Andrew Shitov #4
Re: call one perl script within another
my $return_value = eval {$code_or_sub_programme};
Andrew Shitov Guest
-
Randal L. Schwartz #5
Re: call one perl script within another
>>>>> "David" == David Van Der Geer <David.vanderGeer@axa.nl> writes:
David> ************************************************** *******************
David> This message is intended only for the person or entity to
David> which it is addressed and may contain confidential and/or
David> privileged information, the disclosure of which is prohibited.
David> If you are not the intended recipient you may not read,
David> use, disseminate or copy the information transmitted. If
David> you have received this message in error, please contact
David> the sender and delete the material from any computer.
David> Dit bericht is uitsluitend bestemd voor de (rechts)persoon
David> aan welke het is gericht. Het kan vertrouwelijke of
David> alleen voor deze bestemde informatie bevatten, die niet
David> mag worden geopenbaard. Als dit bericht niet voor u
David> bestemd is, mag u de ontvangen informatie niet lezen,
David> gebruiken, verspreiden of kopieren. Als u dit bericht
David> abusievelijk hebt ontvangen, gelieve u het te deleten en
David> contact op te nemen met de afzender.
David> ************************************************** ******************
David> ************************************************** ********************
David> This email and any files transmitted with it are confidential and
David> intended solely for the use of the individual or entity to whom they
David> are addressed. If you have received this email in error please notify
David> the system manager.
David> This footnote also confirms that this email message has been swept by
David> MIMEsweeper for the presence of computer viruses.
David> [url]www.mimesweeper.com[/url]
David> ************************************************** ********************
Goodness, Gracious!
31 lines of disclaimer, attached to a 15 line message (counting
the quoted material).
As I've said before:
You have exceeded the 4-line .sig boilerplate limit with a
worthless unenforcable disclaimer. Please remove this text from
future postings to this mailing list. If you cannot do so for
mail from your domain, please get a freemail account and rejoin
the list from there.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Randal L. Schwartz Guest
-
Wiggins D Anconia #6
Re: call one perl script within another
'require' is runtime not compile time, so assuming you can regulate the> Andrew Shitov wrote:>> >> >> This will call a new perl process, and may be more expensive on the
> >> system. On the other hand I can do
> > <...>
> >> >> >> But How do I get the reponse of the script.
> >
> > Probably the simpliest way is to make called script a module and run it
> > using either 'use' or 'require'.
> >
> Precisely , But That is something I cannot do because the script is in a
> file which is written on the fly by the client end settings.
>
> Ideally it should have been such a way that The client settings are
> written into a configuration file and the program reads the
> configuraton file and runs the condition.
>
> The point over here is , Is it possible to use the existing instance of
> perl running main to run the child program and return the output
>
sequence of events, aka the file is known to be written (or testable in
a loop) before the call to require then this will still work even if the
file does not exist at runtime. If you are worried about the require
failing because of a missing file then wrap the whole construct in an
'eval' and catch the exceptions (which you should do anyways).
.... still isn't a compelling reason to call one Perl script from another...
[url]http://danconia.org[/url]
Wiggins D Anconia Guest
-
Dan Anderson #7
Re: call one perl script within another
I think there's a function called eval which lets you evaluate perl code
on the fly. [url]http://www.perldoc.com/perl5.8.0/pod/func/eval.html[/url]
-Dan
Dan Anderson Guest
-
Rick Edwards #8
RE: call one perl script within another
System will fork a second shell process from the parent and wait for a
response when the child process exits (which sounds like what you want).
This is not so efficient as exec which kills the parent process.
For system:
my $return = system (my_script, my_argument);
Will start a child process and wait until it completes returning an exit
value.
Regards
Rick
Dr Richard Edwards, Web Developer
Sift, 100 Victoria Street, Bristol, BS1 6HZ, UK
Tel: +44 117 9159600 Fax: +44 117 9159630
[url]http://www.sift.co.uk[/url]
-----Original Message-----
From: Geer, David van der [mailto:David.vanderGeer@axa.nl]
Sent: 21 October 2003 08:03
To: Ramprasad A Padmanabhan; [email]beginners@perl.org[/email]
Subject: RE: call one perl script within another
This will fork and open a shell so is slow> How Can I call a perl script within my main script
> If I do
> $response=`perl $somescript $args`;
Please look at system() and exec() this should help you out.> do "$somescript $args";
> But How do I get the reponse of the script.
> Is there a way or should I just use the backticks
Regs David
> Thanks
> Ram
Rick Edwards Guest
-
ramya #9
Re: call one perl script within another
When i am running the below program i got the error as permission denied
/usr/bin/perl -w
print ”this is calling script \n ";
system "/myhome/caller_script.pl”;
exit;
I need to write a script that should call another script
pls help me.ramya Guest



Reply With Quote

