Text::...up::Cmd(3pm)

πŸ“¦
version 0.41 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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 (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