CGI_TO_DB(1)
π CGI_TO_DB(1) π
okay bestie, welcome to cgi_to_db from the User Contributed Perl Documentation corner of the universe. this is the little converter that takes your stored CGI files and turns them into fsdb, and yes, it's giving data-glow-up energy. π
π NAME π
cgi_to_db β convert stored CGI files (from CGI.pm) to fsdb. literally that's the whole vibe. β¨
πΈ SYNOPSIS πΈ
cgi_to_db [-duU] [-e EmptyValue] [cgi-files...]
π¦ DESCRIPTION π¦
okay so this program converts all stored CGI files (from CGI.pm) to fsdb, and it can optionally unescape 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. that's non-negotiable, bestie. π
Unlike most Fsdb programs, the input to this program is not usually from standard input. however, the program will take -i options. so don't come for it. π
heads up: this program requires temporary storage equal to the size of the data. why? so it can handle the case of different entries having different headers. it's lowkey doing extra credit work. π
β¨ OPTIONS β¨
-u,--unescapeβ do unescape data, converting CGI escape codes like%xxto regular characters. this is the default, so it's already main character energy. π-U,--nounescapeβ do not unescape data, but leave it CGI-encoded. sometimes you want the original coded vibe, and that's valid. π«Ά-e E,--empty Eβ give valueEas the value for empty (null) records. fill in the blank, bestie. π-T TmpDirβ where to put tmp files. it also uses the environment variableTMPDIRif-Tis not specified. default is/tmp. yes, exactly/tmp. no guessing. β¨
This module also supports the standard fsdb options:
-dβ enable debugging output. turn it on when you need the gossip. π-i,--input InputSourceβ read from InputSource, typically a file name, or-for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. plural objects, okay? π-o,--output OutputDestinationβ write to OutputDestination, typically a file name, or-for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. same energy, output edition. π--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. control freak? iconic. π--helpβ show help. short and sweet. π--manβ show full manual. you're literally here, but okay, slay. π
π§ 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 π
π 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. fr fr, read the file. π
π cute little sign-off: this page is perl v5.32.1, dated 2024-08-02, and belongs to CGI_TO_DB(1). bye bestie, go convert some CGI and slay! π
β¨
π¦ 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