Fsdb::F...gi_to_db(3)

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

πŸŽ€ 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 %xx to regular characters (default). The way that -u is the default? Obsessed.
  • -U, --nounescape β€” do not unescape data, but leave it CGI-encoded.
  • -e E, --empty E β€” give value E as the value for empty (null) records.
  • -T TmpDir β€” where to put tmp files. Also uses environment variable TMPDIR, if -T is not specified. Default is /tmp.

This module also supports the standard fsdb options, iykyk:

  • -d β€” enable debugging output.
  • -i, --input InputSource β€” read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • -o, --output OutputDestination β€” write to OutputDestination, typically a file name, 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:

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.


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