Text::...up::Cmd(3pm)
π NAME π
Text::Markup::Cmd β literally just tools for running external commands, bestie π«Ά
β¨ SYNOPSIS β¨
use Text::Markup::Cmd;
my $fh = open_pipe(qw(perl -V));
πΈ DESCRIPTION πΈ
okay so Text::Markup::Cmd is the plug for all your Text::Markup parsers that can't do their lil thing without calling out to an external command β think Text::Markup::Rest and Text::Markup::AsciiDoctor, yeah those ones π
ngl this is mainly gonna be your fave if you're out here adding a brand new parser that has one of those external-command dependencies. it's giving "niche but essential", and honestly? iconic. π
π¦ Interface π¦
π Exported Functions π
WIN32
my $exe = 'nerble' . (WIN32 ? '.exe' : '');
a constant that tells you whether the current runtime environment (that's the OS, bestie) is Windows or not. periodt. πͺ
find_cmd
my $cmd = find_cmd(
['nerble' . (WIN32 ? '.exe' : ''), 'nerble.rb'],
'--version',
);
this one goes snooping down the path for one or more named commands π it hands you back the first command it finds in the path that actually runs with the command line options you gave it, and does so without error β¨ no chaos, no drama.
heads up bestie: the caller has to specify the OS-appropriate spellings of the commands themselves. it will not do that for you, no cap. π
exec_or_die
exec_or_die(
qq{Missing required Python "docutils" module},
$PYTHON, '-c', 'import docutils',
);
runs a command plus its arguments, and if that command fails it straight up dies with the error argument you passed in π (dramatic? maybe. effective? absolutely.)
open_pipe
my $fh = open_pipe(qw(nerble --as-html input.nerb));
executes a command and its arguments and gives you back a file handle opened to its STDOUT π if the command fails, it dies. that's the whole vibe. π
π AUTHOR π
David E. Wheeler <david@justatheory.com> π«Ά
π COPYRIGHT AND LICENSE π
Copyright (c) 2012-2025 David E. Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay. β
and that's the whole page, bestie π this lil cutie came to you via perl v5.40.1, dated 2025-12-18, and it's filed under Text::...up::Cmd(3pm) in the User Contributed Perl Documentation. mwah πβ¨
π¦ where this page comes from
- ubuntu resolute: libtext-markup-perl 0.41-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-markup-perl 0.41-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms