.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::Markup::Cmd 3pm" .TH Text::Markup::Cmd 3pm 2024-03-03 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH Name .IX Header "Name" Text::Markup::Cmd \- Tools for external commands .SH Synopsis .IX Header "Synopsis" .Vb 2 \& use Text::Markup::Cmd; \& my $fh = open_pipe(qw(perl \-V)); .Ve .SH Description .IX Header "Description" 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. .PP \fIInterface\fR .IX Subsection "Interface" .SS "Exported Functions" .IX Subsection "Exported Functions" \fR\f(CI\*(C`WIN32\*(C'\fR\fI\fR .IX Subsection "WIN32" .PP .Vb 1 \& my $exe = \*(Aqnerble\*(Aq . (WIN32 ? \*(Aq.exe\*(Aq : \*(Aq\*(Aq); .Ve .PP Constant indicating whether the current runtime environment (OS) is Windows. .PP \fR\f(CI\*(C`find_cmd\*(C'\fR\fI\fR .IX Subsection "find_cmd" .PP .Vb 4 \& my $cmd = find_cmd( \& [\*(Aqnerble\*(Aq . (WIN32 ? \*(Aq.exe\*(Aq : \*(Aq\*(Aq), \*(Aqnerble.rb\*(Aq], \& \*(Aq\-\-version\*(Aq, \&); .Ve .PP 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. .PP \fR\f(CI\*(C`exec_or_die\*(C'\fR\fI\fR .IX Subsection "exec_or_die" .PP .Vb 4 \& exec_or_die( \& qq{Missing required Python "docutils" module}, \& $PYTHON, \*(Aq\-c\*(Aq, \*(Aqimport docutils\*(Aq, \& ); .Ve .PP Executes a command and its arguments. Dies with the error argument if the command fails. .PP \fR\f(CI\*(C`open_pipe\*(C'\fR\fI\fR .IX Subsection "open_pipe" .PP .Vb 1 \& my $fh = open_pipe(qw(nerble \-\-as\-html input.nerb)); .Ve .PP Executes a command and its arguments and returns a file handle opened to its \f(CW\*(C`STDOUT\*(C'\fR. Dies if the command fails. .SH Author .IX Header "Author" David E. Wheeler .SH "Copyright and License" .IX Header "Copyright and License" Copyright (c) 2012\-2024 David E. Wheeler. Some Rights Reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.