IO::Pipe::ProducerIO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. | |
Download |
IO::Pipe::Producer Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Robert W. Leach
- Publisher web site:
- http://search.cpan.org/~robleach/IO-Pipe-Producer-1.5/lib/IO/Pipe/Producer.pm
IO::Pipe::Producer Tags
IO::Pipe::Producer Description
IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer.SYNOPSIS # Module which provides 2 methods: getSubroutineProducer # and getSystemProducer. They take a subroutine reference # (with associated arguments) and a system call # respectively and return (blessed) handles on their # streaming standard output and standard error output. # EXAMPLES of usage use IO::Pipe::Producer; $obj = new IO::Pipe::Producer(); $stdout_fh = $obj->getSubroutineProducer($subroutine_reference, @subroutine_parameters); # OR use IO::Pipe::Producer; $obj = new IO::Pipe::Producer(); ($stdout_fh,$stderr_fh) = $obj->getSubroutineProducer($subroutine_reference, @subroutine_parameters); # OR use IO::Pipe::Producer; $stdout_fh = new IO::Pipe::Producer($subroutine_reference, @subroutine_parameters); # OR use IO::Pipe::Producer; ($stdout_fh,$stderr_fh) = new IO::Pipe::Producer($subroutine_reference, @subroutine_parameters); # Then you can read the returned handles like any other # file handle... while() {print "STDOUT From Producer: $_"} while() {print "STDERR From Producer: $_"} # You can also do the same thing with system calls using # the getSystemProducer subroutine. However, this feature # is not accessible via the new constructor use IO::Pipe::Producer; $obj = new IO::Pipe::Producer(); $stdout_fh = $obj->getSystemProducer("echo "Hello World!""); use IO::Pipe::Producer; $obj = new IO::Pipe::Producer(); ($stdout_fh,$stderr_fh) = $obj->getSystemProducer("echo "Hello World!""); # However, this is exactly the same as: use IO::Pipe::Producer; $stdout_fh = new Producer(sub{system(@_)}, "echo "Hello World!""); # OR use IO::Pipe::Producer; ($stdout_fh,$stderr_fh) = new IO::Pipe::Producer(sub{system(@_)}, "echo "Hello World!""); Requirements: · Perl
IO::Pipe::Producer Related Software