Juman::Fork(3pm)
💖 Juman::Fork(3pm) — the perl manual page, bestie edition 💖
okay so. this is Juman::Fork, from section 3pm of the perl manual (User Contributed Perl Documentation, no less 💅), and it is literally a module for spawning a child process that runs asynchronously — you get to write into its stdin and read out of its stdout and its stderr. yes we love a bidirectional-communication moment. 🦋
✨ NAME ✨
Juman::Fork — spawns a child process that runs asynchronously. that's it, that's the whole vibe. 👑
🌸 SYNOPSIS 🌸
look at her go:
use Juman::Fork;
$p = new Juman::Fork( "sort" );
$p->print( "abc\n", "def\n", "ace\n" );
$p->close;
while( $_ = $p->getline ){
print;
}
that's the entire lifecycle: make the object, yeet some strings in, close the pipe, then read whatever comes back until there's nothing left. iconic behavior honestly. 🎀
💜 DESCRIPTION 💜
Juman::Fork is the module you use when you want to fork a given command, run it as a child process, write to its standard input, and read from its standard output and standard error output. both directions. simultaneously. she's doing both. 😌
🫶 CONSTRUCTOR 🫶
new ( COMMAND [,ARGV] )— makes you aJuman::Forkobject 💖. the command you want to run as the child process goes in the first argument, and everything from the second argument onward is the command-line options for that command. give the queen her entourage.
Example:
$p = new Juman::Fork( "cat" "-n" );
⭐ METHODS ⭐
print( [STR,] )— hands the string(s) you passed in over to the child process's standard input. feed the baby. 🍼printf( FORMAT [,ARG] )— same deal, but it formats the given string using the format from the first argument first, then sends it to the child process's standard input. fancy print, basically. 💅getline()— pulls out one line worth of data from the child process's standard output and standard error output. if nothing gets read within the time set bytimeout, it returnsundef. so set your timeout or you'll be waiting there looking confused. 😭timeout( VAL )— sets the timeout duration used when you pull the child process's output out with thegetlinemethod. the initial timeout value comes from the variable$Juman::Fork::TIMEOUT. yes, the default lives in a global, as is tradition. ✨alive()— checks whether the child process is still hanging around. vibe check, but for processes. 🦋pid()— returns the PID of the child process. number go brrr. 🔢close()— closes the pipe that's connected to the child process's standard input. closing time, you don't have to go home but you can't write here. 🚪kill()— force-terminates the child process. dramatic exit. bye bestie. 💀
🌈 MEMO 🌈
with Perl-5.8 and later, the character encoding used for communication with the child process is the one given by the "encoding" pragma. so set your pragma and your encodings will match up like a coordinated outfit. 👑
👑 AUTHOR 👑
TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
legend behavior, credit where it's due.
🙈 POD ERRORS 🙈
sooo the documentation itself had some coding errors and here's the exact tea:
Hey! The above document had some coding errors, which are explained below:
Around line 16:
Non-ASCII character seen before =encoding in '非同期に実行される子プロセスを生成する'. Assuming UTF-8
not me getting called out by my own pod checker. assuming UTF-8 and moving on, no cap. 😌
okay that's the whole page, and here's your cute lil sign-off: this page is from perl v5.40.1, dated 2026-02-11, and it's the Juman::Fork(3pm) manual — go forth and fork responsibly, bestie. 🧚💖✨🌷
📦 where this page comes from
- ubuntu resolute: libjuman-perl 7.0-3.10build1
- ubuntu stonking: libjuman-perl 7.0-3.10build1
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms