IPC::PrettyPipe::Stream - An I/O stream for an IPC::PrettyPipe pipeline or command
version 0.13
use IPC::PrettyPipe::Stream; # standard constructor $stream = IPC::PrettyPipe::Stream->new( spec => $spec, %attr ); $stream = IPC::PrettyPipe::Stream->new( spec => $spec, file => $file, %attr ); # concise constructors $stream = IPC::PrettyPipe::Stream->new( $spec ); $stream = IPC::PrettyPipe::Stream->new( [ $spec, $file ] );
IPC::PrettyPipe::Stream objects represent I/O streams attached to either IPC::PrettyPipe or IPC::PrettyPipe::Cmd objects.
# named parameters; may provide additional attributes $stream = IPC::PrettyPipe::Stream->new( spec => $spec, file => $file, %attr ); $stream = IPC::PrettyPipe::Stream->new( \%attr ); # concise interface $stream = IPC::PrettyPipe::Stream->new( $spec ); $stream = IPC::PrettyPipe::Stream->new( [ $spec, $file ] );
The available attributes are:
spec
A stream specification. See IPC::PrettyPipe::Stream::Utils for more information.
file
The optional file attached to the stream. A file is not needed if the specification is for a redirection or a close.
strict
If true, die if the stream specification requires a file but one is not provided, or it does not require a file and one is provided.
$spec = $stream->spec;
Retrieve the specification passed in to the constructor.
$file = $stream->file;
Return the file passed in to the constructor (if one was).
$file = $stream->quoted_file;
Return the file passed in to the constructor (if one was), appropriately quoted for passing as a single word to a Bourne compatible shell.
$bool = $stream->has_file;
Returns true if a file was passed to the constructor.
$bool = $stream->requires_file;
Returns true if the stream specification requires a file.
$Op = $stream->Op; $N = $stream->N; $M = $stream->M;
Retrieve the components of the specification.
$bool = $stream->has_N; $bool = $stream->has_M;
Return true if the stream specification contained the associated component.
( $sub, @fh ) = $stream->apply;
Returns a subroutine which will implement the stream operations and and a list of filehandles or descriptors which would be affected. This routine is used by backend wrappers in conjunction with IO::ReStoreFH to handle pipe level stream operations (rather than command stream operations, which are done by the actual backend modules).
Please report any bugs or feature requests to bug-ipc-prettypipe@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=IPC-PrettyPipe
Source is available at
https://gitlab.com/djerius/ipc-prettypipe
and may be cloned from
https://gitlab.com/djerius/ipc-prettypipe.git
Please see those modules/websites for more information related to this module.
IPC::PrettyPipe
Diab Jerius <djerius@cpan.org>
This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install IPC::PrettyPipe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IPC::PrettyPipe
CPAN shell
perl -MCPAN -e shell install IPC::PrettyPipe
For more information on module installation, please visit the detailed CPAN module installation guide.