NAME

IPC::PrettyPipe::Stream::Utils - support utilities for streams

VERSION

version 0.12

SYNOPSIS

  use IPC::PrettyPipe::Stream::Utils qw[ parse_spec ];

  $opc = parse_spec( $op );

DESCRIPTION

Stream Specification

A stream specification is a string which may take one of the forms in the Spec column:

  Spec    Op    Mode    File    Function
  ----    ---  ----    ----    -----------------------
  <       <     I       y       read from file via fd 0
  <N      <     I       y       read from file via fd N
  >       >     O       y       write to file via fd 1
  >N      >     O       y       write to file via fd N

  >&      >&    O       n       redirect fd 2 to fd 1
  &>      &>    O       n       redirect fd 2 to fd 1

  N<&-    <&-   ?       n       close fd N

  M<&N    <&    I       n       dup fd M as fd N
  N>&M    >&    O       n       dup fd M as fd N

 where
  • M and N are integers indicating file descriptors

  • Mode indicates input (I), output (O), or not applicable (?)

  • File indicates whether an additional parameter with a file name is required.

Any resemblance to stream operators used by IPC::Run is purely non-coincidental.

FUNCTIONS

IPC::PrettyPipe::Stream::Utils exports the following functions upon request:

parse_spec
  $components = parse_spec( $spec )

Parse a stream specification into components Op, N, and M. Returns a hashref with the information indexed by the component names.

If the specification indicates that additional parameters are required (such as the name of a file to be read or written to), the key param will be set.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=IPC-PrettyPipe or by email to bug-IPC-PrettyPipe@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SOURCE

The development version is on github at https://github.com/djerius/ipc-prettypipe and may be cloned from git://github.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