| 1 | # | ||
| 2 | # Copyright (c) 2003-2022 Christian Jaeger, copying@christianjaeger.ch | ||
| 3 | # | ||
| 4 | # This is free software, offered under either the same terms as perl 5 | ||
| 5 | # or the terms of the Artistic License version 2 or the terms of the | ||
| 6 | # MIT License (Expat version). See the file COPYING.md that came | ||
| 7 | # bundled with this file. | ||
| 8 | # | ||
| 9 | |||
| 10 | # Depends: () | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | Chj::xoutpipe | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | use Chj::xoutpipe; | ||
| 19 | { | ||
| 20 | my $p = xoutpipe "sendmail","-t"; | ||
| 21 | $p->xprint("From: $from\n"); | ||
| 22 | my $rv = $p->xfinish; # does close and waitpid, returns $? | ||
| 23 | # see Chj::IO::Command for more methods. | ||
| 24 | } | ||
| 25 | |||
| 26 | =head1 DESCRIPTION | ||
| 27 | |||
| 28 | Start external process with a writing pipe attached. Return the filehandle which | ||
| 29 | is a Chj::IO::Command (which is a Chj::IO::Pipe which is a Chj::IO::File) object. | ||
| 30 | |||
| 31 | =head1 SEE ALSO | ||
| 32 | |||
| 33 | L<Chj::IO::File>, L<Chj::xsysopen>, L<Chj::xopendir> | ||
| 34 | |||
| 35 | =head1 NOTE | ||
| 36 | |||
| 37 | This is alpha software! Read the status section in the package README | ||
| 38 | or on the L<website|http://functional-perl.org/>. | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | package Chj::xoutpipe; | ||
| 43 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | 2 | ▶ | use warnings FATAL => 'uninitialized'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | 2 | ▶ | use Chj::IO::Command; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 47 | 2 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | |||
| 49 | 2 | our @EXPORT = qw(xoutpipe); | |
| 50 | |||
| 51 | 0 | ▶ | sub xoutpipe { |
|
Subroutine
xoutpipe: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 52 | 0 | Chj::IO::Command->new_receiver(@_); | |
| 53 | } | ||
| 54 | 2 | *Chj::xoutpipe = \&xoutpipe; | |
| 55 | |||
| 56 | 2 | 1 | |