Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Steve_p's scratchpad

by Steve_p (Priest)
on Jun 01, 2004 at 21:00 UTC ( [id://358600]=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl use strict; use warnings; use POSIX ':fcntl_h'; use IPC::Run 'run'; my $fifo = "test_fifo"; unless ( -p $fifo ) { system("mkfifo", $fifo) == 0 or die "Unable to create FIFO: $!"; } # FIFOs need readers before writers. sysopen FIFO_OUT, $fifo, O_RDONLY | O_NONBLOCK or die "Unable to ope +n FIFO for read: $!"; sysopen FIFO_IN, $fifo, O_WRONLY | O_NONBLOCK or die "Unable to ope +n FIFO for write: $!"; run ( ["cat", "pipe.pl"], ">", \*FIFO_IN, "<", \*FIFO_OUT ); while (<FIFO_OUT>) { chomp; print "Foo: ", $_, ": Bar.\n"; } close FIFO_IN or die "Problems closing FIFO writer: $!"; close FIFO_OUT or die "Problems closing FIFO reader: $!";
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2025-05-18 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.