Fetching contributors…
Cannot retrieve contributors at this time
58 lines (41 sloc) 1.04 KB
# Copyright (c) 2003-2014 Christian Jaeger,
# This is free software, offered under either the same terms as perl 5
# or the terms of the Artistic License version 2 or the terms of the
# MIT License (Expat version). See the file that came
# bundled with this file.
=head1 NAME
use Chj::xpipe;
my ($read,$write)=xpipe; # or xpipe READ,WRITE ? hmmm. not yet.
Returns two Chj::IO::Pipe filehandles/objects.
=head1 NOTE
You should trap SIGPIPE or the program will exit before an exception
is thrown.
=head1 SEE ALSO
L<Chj::IO::Pipe>, L<Chj::IO::File>
package Chj::xpipe;
require Exporter;
@EXPORT= qw(xpipe);
use strict; use warnings; use warnings FATAL => 'uninitialized';
use Chj::IO::Pipe;
use Carp;
sub xpipe {
if (@_) {
confess "form with arguments not yet supported";
} else {
my $r=new Chj::IO::Pipe;
my $w=new Chj::IO::Pipe;
pipe $r,$w or croak "xpipe: $!";