capturing output of FILEHANDLE "| command" 
Author Message
 capturing output of FILEHANDLE "| command"

Hello,

I have a little perl script that takes incoming mail, parses it up, and  
outputs some SQL code to sybase with pieces of the mail message in it.

open (DATABASE, "| $ISQL");
print DATABASE <<"HERE";
..
SQL code
..
HERE
close(DATABASE);

This works great. only now the database is going to start giving me data  
back that I need to take and send back to the originator of the email  
message.  I am having a problem captuing that data back, and I was wondering  
if anyone out here could help.

open(DATABASE, "| $ISQL > /tmp/$0.$$"); seems to work, and I can{*filter*} 
around with the output file -- but I would rather not deal with a separate  
file.


right thing for me

Does anyone else have any solutions? what I really want is to open another  
filehandle to the databases output, but it appears that this is impossible.  
I would prefer to do this without having to muck around with temp file.

Thanks! email would be appreciated.
-graham



Sun, 04 Aug 1996 04:21:12 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CGI to capture "multiple select" output

2. "ps" command output

3. capturing command line error or output from `<command>`

4. Group capturing and "nested" regex

5. capturing "after this" to the eof

6. Group capturing and "nexted" regex

7. "character class ""bug""

8. select() on a "process" filehandle

9. Is "write FILEHANDLE" supposed to set $=

10. Using "local" filehandles in Perl 5

11. "symbolic" filehandles

12. Filehandle "|mail" Question

 

 
Powered by phpBB® Forum Software