Fsdb::Support(3)

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

πŸ’– NAME πŸ’–

Fsdb::Support - support routines for Fsdb. periodt.

✨ SYNOPSIS ✨

This class contains the bits of Fsdb::Old that needed to be kept.

that's the whole synopsis, no cap ✨

πŸ› οΈ FUNCTIONS πŸ› οΈ

okay bestie, here's the function fam. keep your eyes on the headings, because this page has some duplicate-looking section names and we're keeping them exactly as they are. 🫢

πŸ“ LOGGING REALTED FUNCTIONS πŸ“

yes, REALTED is spelled like that on the page β€” I'm not fixing it, I'm just reporting the vibe πŸ’…

progname

Generate the name of our program for error messages. literally just the program name, for when errors need to say who's who.

🧡 IO SETUP FUNCTIONS 🧡

this is where you spin up default reader/writer objects.

default_in(@READER_OPTIONS)

Generate a default Fsdb::Reader object with the given READER_OPTIONS. bestie, it's giving "make me a reader with these options."

default_out(@WRITER_OPTIONS)

Generate a default Fsdb::Writer object with the given READER_OPTIONS. yes, the page says READER_OPTIONS here too β€” I am not changing it, okay? πŸ™ˆ

πŸ” CONVERSION FUNCTIONS πŸ”

code prettifying and shell quoting live here.

code_prettify

Convert db-code into "pretty code". iconic.

shell_quote

Convert output to shell-like quoting. slay.

πŸ” CONVERSION FUNCTIONS πŸ”

okay and here's the second CONVERSION FUNCTIONS block β€” the page really has it twice, I'm not buggin'. πŸŒ€

number_prettify

Add-thousands-separators to numbers.

xxx: should consider locale.

Source credit, exactly as the page gives it: (This code is from http://www.perlmonks.org/?node_id=653, contributed by Andrew Johnson from University of Alberta.)

force_numeric

my $x = force_numeric($s, $include_non_numeric)

Return $S if it's numeric, or "undef" if not. If $INCLUDE_NON_NUMERIC, then non-numeric values register as zero. that's the whole rule.

fullname_to_sortkey

my $sortkey = fullname_to_sortkey("John Smith");

Convert "Firstname Lastname" to sort key "lastname, firstname". cute little name flip.

ddmmmyy_to_iso

my $iso_date = ddmmmyy_to_iso('1-Jan-10')

Converts a date in the form dd-mmm-yy to ISO-style yyyy-mm-dd. Examples, verbatim:

2-Jan-70 to 1970-01-02 2-Jan-99 to 1999-01-02 2-Jan-10 to 2010-01-02
2-Jan-69 to 2069-01-02 Jan-10 to 2010-01-00 99 to 1999-00-00

int_to_metric

my $value_str = int_to_metric(1000000);

Converts an integer into a string with its metric abbreviation.

1000 => 1k 1000000 => 1M

and that's the tea β˜• β€” this page is Fsdb::Support(3), from perl v5.32.1, dated 2024-08-02. bye bestie, go slay some support routines πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from