CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [FishMonger] send to a db and then to a script: Edit Log



7stud
Enthusiast

Mar 26, 2010, 4:03 PM


Views: 4276
Re: [FishMonger] send to a db and then to a script

Ah, I see what you did now. You did do a 'pipe open':


Quote
perlopen

For three or more arguments if MODE is '|-' , the filename is interpreted as a command to which output is to be piped, and if MODE is '-|' , the filename is interpreted as a command which pipes output to us. In the 2-arguments (and 1-argument) form one should replace dash ('-' ) with the command.


I've never seen a pipe open written using that format. When I see '|-', I associate that with a 'fork open'--as described in perlipc section Safe Pipe Opens. In any case, either format for a 'pipe open' works for me in the script I posted (on unix like mac osx 10.4.11).

If you were attempting to pass the data to the other program as a command line argument, then according to perlopen you can do that using the 4-arg open():


Code
open my $PIPE_WRITER, '|-', '../helper_programs/myprog.pl', $college 
or die "Couldn't open pipe to myprog.pl: $!";


and then in the other program...


Code
my $received_data = shift @ARGV;



(This post was edited by 7stud on Mar 27, 2010, 1:26 AM)


Edit Log:
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 4:04 PM
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 4:13 PM
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 5:05 PM
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 5:06 PM
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 5:07 PM
Post edited by 7stud (Enthusiast) on Mar 26, 2010, 5:08 PM
Post edited by 7stud (Enthusiast) on Mar 27, 2010, 1:26 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives