No::Worries(3)
๐ No::Worries(3) โ coding without worries โจ
okay so bestie, this is a page from the User Contributed Perl Documentation, and honestly? it ate. it's the manual for No::Worries, and no cap, the name is not a lie ๐ซถ
๐ธ NAME ๐ธ
No::Worries โ coding without worries ๐
โจ SYNOPSIS โจ
use No::Worries qw($HostName $ProgramName);
printf("host is %s\n", $HostName);
printf("program is %s\n", $ProgramName);
that's literally it, she's lowkey effortless ๐ญ
๐ฆ DESCRIPTION ๐ฆ
So this module and all its sub-modules exist to make your coding life easier, by giving you consistent, convenient functions for the programming tasks you keep doing over and over. it's giving "why do it manually when you don't have to" energy ๐
This module also exposes the $HostName and $ProgramName variables, which represent what the sub-modules think the host name or program name is. and yes โ you can change them if you need to. main character variables, honestly ๐
๐ PROGRAMMING STYLE ๐
๐ ERROR HANDLING ๐
Okay so this is the big one: all the functions die() on error, so you literally never have to worry about error checking. by default, any error will just stop the code execution โ periodt. the recommended way to catch errors is to use eval(). iconic.
For consistency (and we love consistency), all the sub-modules use No::Worries::Die's dief() to report errors, and No::Worries::Warn's warnf() to report warnings. and! the NO_WORRIES environment variable can be used to control how errors and warnings are reported โ see No::Worries::Die and No::Worries::Warn for the deets ๐
๐ OPTION PASSING ๐
All the functions use the same consistent API with hashes to pass options, like this:
dir_make("/tmp/some/path", mode => 0770);
ngl, this is a bit overkill when only one option is supported, but it means options can be added later without breaking old code. future-proof queen โจ
The options can also be passed via a hash reference (which is useful when you want to avoid data copying):
dir_make("/tmp/some/path", { mode => 0770 });
All the options are checked using Params::Validate. no vibes-based validation here, we check ๐ซถ
๐ง SYMBOL IMPORTING ๐ง
All the modules are "clean" โ meaning they do NOT import any symbol into the caller's namespace. every symbol you need (usually functions) has to be explicitly imported, like:
use No::Worries::Die qw(dief);
In addition, all "normal" symbols can be imported at once using the asterisk character:
use No::Worries::Log qw(*);
one asterisk and you get the whole fit ๐ it's giving deluxe bundle
๐ MODULES ๐
Here are the relevant sub-modules and what they provide โ bestie, this list is long but every single one matters ๐
๐ No::Worries::Date โ date handling:
date_parse(STRING)date_stamp([TIME])date_string([TIME])
๐ No::Worries::Die โ error handling:
dief(FORMAT, ARGUMENTS...)
๐ No::Worries::Dir โ directory handling:
dir_change(PATH)dir_ensure(PATH[, OPTIONS])dir_make(PATH[, OPTIONS])dir_parent(PATH)dir_read(PATH)dir_remove(PATH)
๐ชช No::Worries::DN โ Distinguished Names handling:
dn_parse(STRING)dn_string(DN, FORMAT)
๐ฆ No::Worries::Export โ export control:
export_control(CALLERPKG, PKG, EXPORT, NAMES...)
๐ No::Worries::File โ file handling:
file_read(PATH[, OPTIONS])file_write(PATH[, OPTIONS])file_update(PATH[, OPTIONS])
๐ No::Worries::Log โ logging (log and filter information):
log_filter(FILTER)log_configure(PATH)log_wants_error()log_wants_warning()log_wants_info()log_wants_debug()log_wants_trace()log_error(ARGUMENTS)log_warning(ARGUMENTS)log_info(ARGUMENTS)log_debug(ARGUMENTS)log_trace()log2std(INFO)log2dump(INFO)
๐ No::Worries::PidFile โ pid file handling:
pf_set(PATH[, OPTIONS])pf_check(PATH[, OPTIONS])pf_unset(PATH)pf_touch(PATH)pf_sleep(PATH[, OPTIONS])pf_status(PATH[, OPTIONS])pf_quit(PATH[, OPTIONS])
โ๏ธ No::Worries::Proc โ process handling:
proc_output(COMMAND...)proc_create(OPTIONS)proc_terminate(PROC[, OPTIONS])proc_monitor(PROCS[, OPTIONS])proc_run(OPTIONS)proc_detach([OPTIONS])proc_status(STATUS)
๐ No::Worries::Stat โ file status handling:
stat_ensure(PATH[, OPTIONS])stat_type(MODE)
๐ค No::Worries::String โ string handling:
string_bytefmt(NUMBER[, PRECISION])string_escape(STRING)string_plural(STRING)string_quantify(NUMBER, STRING)string_table(TABLE[, OPTIONS])string_trim(STRING)
๐ก No::Worries::Syslog โ syslog handling:
syslog_open([OPTIONS])syslog_close()syslog_sanitize(STRING)syslog_debug(FORMAT, ARGUMENTS...)syslog_info(FORMAT, ARGUMENTS...)syslog_warning(FORMAT, ARGUMENTS...)syslog_error(FORMAT, ARGUMENTS...)log2syslog(INFO)
โ ๏ธ No::Worries::Warn โ warning handling:
warnf(FORMAT, ARGUMENTS...)
๐ฑ ENVIRONMENT VARIABLES ๐ฑ
The No::Worries::Die and No::Worries::Warn modules use the NO_WORRIES environment variable to control how errors and warnings should be reported. one env var to rule them all ๐
โญ GLOBAL VARIABLES โญ
This module uses the following global variables โ and guess what, they can all be imported ๐
$HostNameโ the name of the host this program runs on (default: derived fromSys::Hostname)$ProgramNameโ the name of the program currently running (default: derived from$0)
๐ฎ SEE ALSO ๐ฎ
No::Worries::Date, No::Worries::Die, No::Worries::Dir, No::Worries::DN, No::Worries::Export, No::Worries::File, No::Worries::Log, No::Worries::PidFile, No::Worries::Proc, No::Worries::Stat, No::Worries::String, No::Worries::Syslog, No::Worries::Warn, Params::Validate.
like a whole friend group, fr fr ๐ซถ
๐ AUTHOR ๐
Lionel Cons <http://cern.ch/lionel.cons>
Copyright (C) CERN 2012-2019
and that's the whole page, bestie ๐ this one's running on perl v5.32.1, dated 2021-10-18 โ so it's a vintage, and it still slays โจ๐ธ๐
๐ฆ where this page comes from
- epel 9: perl-No-Worries 1.7-1.el9 ยท GPL+ or Artistic
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms