CGI_TO_DB(1)

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

πŸŽ€ 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 %xx to 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 value E as the value for empty (null) records. fill in the blank, bestie. πŸŽ€
  • -T TmpDir β€” where to put tmp files. it also uses the environment variable TMPDIR if -T is 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) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. plural objects, okay? 😭
  • -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. same energy, output edition. πŸ’–
  • --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. 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 πŸŽ€

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