Fsdb::F...gi_to_db(3)
π NAME π
Okay so bestie, welcome to Fsdb::F...gi_to_db(3) β the User Contributed Perl Documentation page for cgi_to_db, which literally converts stored CGI files (from CGI.pm) to fsdb. Iconic. π
β¨ SYNOPSIS β¨
cgi_to_db [-duU] [-e EmptyValue] [cgi-files...]
πΈ DESCRIPTION πΈ
cgi_to_db converts all stored CGI files (from CGI.pm) to fsdb, and optionally unescapes the contents. When contents are unescaped, CR NL is recoded as \n. No cap.
Output is always in fsdb list format with double space (type S) field separator. Periodt.
Unlike most Fsdb programs, the input to this program is not usually from standard input. However, the program will take -i options. Main character energy, honestly.
Heads up bestie: this program requires temporary storage equal to the size of the data (so that it can handle the case of different entries having different headers). Plan accordingly. π«Ά
π OPTIONS π
-u,--unescapeβ do unescape data, converting CGI escape codes like%xxto regular characters (default). The way that-uis the default? Obsessed.-U,--nounescapeβ do not unescape data, but leave it CGI-encoded.-eE,--emptyE β give value E as the value for empty (null) records.-TTmpDir β where to put tmp files. Also uses environment variableTMPDIR, if-Tis not specified. Default is/tmp.
This module also supports the standard fsdb options, iykyk:
-dβ enable debugging output.-i,--inputInputSource β read from InputSource, typically a file name, or-for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-o,--outputOutputDestination β write to OutputDestination, typically a file name, or-for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorun,--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. The--(no)autorunoption controls that behavior within Perl.--helpβ show help.--manβ show full manual.
π SAMPLE USAGE π
π Input:
file A (TEST/cgi_to_db_ex.in):
name=test
id=111-11-1111
email=test%40usc.edu
submit_time=Tue%20Jan%2014%2011%3A32%3A39%202003
=
file B (TEST/cgi_to_db_ex.in-2):
name=test2
id=222-22-2222
email=test2%40usc.edu
newfield=foo
emptyfield=
submit_time=Tue%20Jan%2024%2022%3A32%3A39%202003
=
π¬ Command:
cgi_to_db TEST/cgi_to_db_ex.in TEST/cgi_to_db_ex.in-2
π Output:
#fsdb -R C -F S name id email submit_time newfield emptyfield
name: test
id: 111-11-1111
email: test\@usc.edu
submit_time: Tue Jan 14 11:32:39 2003
name: test2
id: 222-22-2222
email: test2\@usc.edu
newfield: foo
emptyfield: -
submit_time: Tue Jan 24 22:32:39 2003
# | cgi_to_db TEST/cgi_to_db_ex.in TEST/cgi_to_db_ex.in-2
π¦ SEE ALSO π¦
π CLASS FUNCTIONS π
πΈ new
$filter = new Fsdb::Filter::cgi_to_db(@arguments);
Create a new cgi_to_db object, taking command-line arguments.
πΈ set_defaults
$filter->set_defaults();
Internal: set up defaults.
πΈ parse_options
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
πΈ setup
$filter->setup();
Internal: setup, parse headers.
πΈ run
$filter->run();
Internal: run over each rows.
π AUTHOR and COPYRIGHT π
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.
Later bestie! This iconic page is from perl v5.32.1, dated 2024-08-02. Mwah πβ¨
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms