Text::Markup::Cmd(3pm)

Text::Markup::Cmd3pm

Tools for external commands

Usage

  use Text::Markup::Cmd;
  my $fh = open_pipe(qw(perl -V));

Overview

Text::Markup::Cmd provides tools for Text::Markup parsers that depend on external commands, such as Text::Markup::Rest and Text::Markup::AsciiDoctor. Will mainly be of interest to those adding a new parser with such a dependency.

Interface

Exported Functions

"WIN32"

  my $exe = 'nerble' . (WIN32 ? '.exe' : '');

Constant indicating whether the current runtime environment (OS) is Windows.

"find_cmd"

  my $cmd = find_cmd(
    ['nerble' . (WIN32 ? '.exe' : ''), 'nerble.rb'],
    '--version',
);

Searches the path for one or more named commands. Returns the first command to be found in the path and which executes with the specified command line options without error. The caller must specify OS-appropriate spellings of the commands.

"exec_or_die"

  exec_or_die(
      qq{Missing required Python "docutils" module},
      $PYTHON, '-c', 'import docutils',
  );

Executes a command and its arguments. Dies with the error argument if the command fails.

"open_pipe"

  my $fh = open_pipe(qw(nerble --as-html input.nerb));

Executes a command and its arguments and returns a file handle opened to its "STDOUT". Dies if the command fails.

Author

David E. Wheeler <[email protected]>

From libtext-markup-perl 0.33-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.