The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IPC::PrettyPipe::Stream - An I/O stream for an IPC::PrettyPipe pipeline or command

VERSION

version 0.13

SYNOPSIS

  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 ] );

DESCRIPTION

IPC::PrettyPipe::Stream objects represent I/O streams attached to either IPC::PrettyPipe or IPC::PrettyPipe::Cmd objects.

METHODS

new
  # 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
  $spec = $stream->spec;

Retrieve the specification passed in to the constructor.

file
  $file = $stream->file;

Return the file passed in to the constructor (if one was).

quoted_file
  $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.

has_file
  $bool = $stream->has_file;

Returns true if a file was passed to the constructor.

requires_file
  $bool = $stream->requires_file;

Returns true if the stream specification requires a file.

Op
N
M
  $Op = $stream->Op;
  $N  = $stream->N;
  $M  = $stream->M;

Retrieve the components of the specification.

has_N
has_M
  $bool = $stream->has_N;
  $bool = $stream->has_M;

Return true if the stream specification contained the associated component.

apply
  ( $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).

SUPPORT

Bugs

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

Source is available at

  https://gitlab.com/djerius/ipc-prettypipe

and may be cloned from

  https://gitlab.com/djerius/ipc-prettypipe.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

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