|-----Original Message-----
|From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
|Sent: Thursday, May 12, 2005 3:01 AM
|To: beginners@perl.org
|Subject: calling a separate perl script from within another perl script
|
|
|All,
|
|I have done some reading and know there are various way to do this, but
|want to if there is an ideal way to call a non local perl script.
|I know it probably matters what one is doing, but in my case all I want to
|do is print the data from one script to the FH of another.
|The ways I know about are
|
|   do 'FILE' ;
|   use lib ".../..../....";
|   require ".../..../.../"
|   use IPC::open
|      open(MYSCRIPT, "foo arg1 $otherargs |" ) or die"$!";
|      scalar=<MYSCRIPT>;
|      close (MYSCRIPT);
|
|
|
|
|
|
| isn't use and require the OO way?
|
|
As far as I understand your question, you can do a simple
open(SCRPOPT,"foo.pl arg1 $otherargs | ") or die("$! : cant fork off
foo.pl") ;
while(<SCRPOPT>) {
##do something with $_ here
}
close(SCRPOPT) or die("$! : bad foo.pl");

Im not sure about IPC::Open , even if its a module or not....
You can read more on this under
perldoc perlipc
section "Using open() for IPC"

|
|
|
|
|thx...
|derek
|
|Derek B. Smith
|OhioHealth IT
|UNIX / TSM / EDM Teams
|
|
|
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|<http://learn.perl.org/> <http://learn.perl.org/first-response>
|
|


*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or 
attachment(s) if any) are privileged and confidential material of MBT and 
should not be disclosed to, used by or copied in any manner by anyone other 
than the intended addressee(s).   In case you are not the desired addressee, 
you should delete this message and/or re-direct it to the sender.  The views 
expressed in this E-mail message (including the enclosure(s) or attachment(s) 
if any) are those of the individual sender, except where the sender expressly, 
and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of 
any virus.  However, it is the responsibility of the recipient to ensure that 
it is virus free and MBT is not responsible for any loss or damage arising in 
any way from its use

*********************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to