Fsdb::F...process(3)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

okay bestie, welcome to the Fsdb::F...process(3) page from User Contributed Perl Documentation β€” it’s all about dbsubprocess, and it’s lowkey iconic for internal Perl filter stuff. πŸ’…βœ¨

πŸ’œ NAME πŸ’œ

dbsubprocess β€” invoke a subprocess as a Fsdb filter object. fr fr, that’s the whole name. 🫢

🌸 SYNOPSIS 🌸

here’s the shape, no cap:

dbsubprocess [--] program [arguments...]

πŸ’… DESCRIPTION πŸ’…

Run PROGRAM as a process, with optional ARGUMENTS as program arguments, feeding its standard input and standard output as fsdb streams. A -- can separate arguments to dbsubprocess from the program and its arguments. πŸ’–

and yeah, as with similar tools like open2, the caller is expected to take care that the subprocess does not deadlock. no pressure or anything 😭

this program is primarily for internal use by dbmapreduce. like dbpipeline, dbsubprocess program does have a Unix command; instead it is used only from within Perl. iykyk. πŸ¦‹

πŸŽ€ OPTIONS πŸŽ€

okay, options time β€” every single one, bestie:

  • -w, --warnings β€” enable warnings in user supplied code. (Default to include warnings.) 🫢
  • -E, --endsub SUB β€” call Perl SUB when the subprocess terminates. The sub runs in the parent and is a Fred ending sub, see Fsdb::Support::Freds. ✨

and the standard fsdb options:

  • -d β€” enable debugging output. πŸ”₯
  • -i, --input InputSource β€” read from InputSource, typically a file, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO objects. (For this case, it cannot be Fsdb::BoundedQueue.) πŸ’–
  • -o, --output OutputDestination β€” write to OutputDestination, typically a file, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. 🌈
  • --autorun, --noautorun β€” by default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The "--(no)autorun" option controls that behavior within Perl. πŸ¦‹
  • --help β€” show help. πŸŽ€
  • --man β€” show full manual. πŸ“–

πŸ¦‹ SAMPLE USAGE πŸ¦‹

πŸ’– Input:

#fsdb name id test1
a       1       80
b       2       70
c       3       65
d       4       90
e       5       70
f       6       90

πŸŽ€ Command:

the following perl code:

use Fsdb::Filter::dbsubprocess;
my $f = new Fsdb::Filter::dbsubprocess(qw(cat));
$f->setup_run_finish;
exit 0;

⭐ Output:

#fsdb name id test1
a       1       80
b       2       70
c       3       65
d       4       90
e       5       70
f       6       90
#   | dbsubprocess cat

πŸ”₯ SEE ALSO πŸ”₯

dbpipeline(1), Fsdb(3) β€” go look, bestie. πŸ‘€

πŸ‘‘ CLASS FUNCTIONS πŸ‘‘

🧚 new

$filter = new Fsdb::Filter::dbsubprocess(@arguments);

Create a new dbsubprocess object, taking command-line arguments. πŸ’…

🌸 set_defaults

$filter->set_defaults();

Internal: set up defaults. πŸŽ€

πŸ¦‹ parse_options

$filter->parse_options(@ARGV);

Internal: parse options. ✨

πŸ“ setup

$filter->setup();

Internal: setup, parse headers. πŸ’–

πŸ”₯ run

$filter->run();

Internal: run over all data rows. 🫢

πŸ’œ finish

$filter->finish();

Internal: run over all data rows. 😭

Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu> πŸ‘‘

This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details. πŸ’–


that’s the whole page, bestie πŸ’… β€” source/version vibes: perl v5.32.1, dated 2024-08-02. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from