Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
No::Worries(3)	      User Contributed Perl Documentation	No::Worries(3)

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);

DESCRIPTION
       This module and its sub-modules ease coding by providing	consistent
       convenient functions to perform frequently used programming tasks.

       This module also	exposes	the $HostName and $ProgramName variables that
       represent what the sub-modules think the	host name or program name is.
       These variables can be changed, if needed.

PROGRAMMING STYLE
   ERROR HANDLING
       All the functions die() on error	so one does not	have to	worry about
       error checking: by default, any error will stop the code	execution. The
       recommended way to catch	errors is to use eval().

       For consistency,	all the	sub-modules use	No::Worries::Die's dief() to
       report errors and No::Worries::Warn's warnf() to	report warnings. The
       NO_WORRIES environment variable can be used to control how errors and
       warnings	are reported (see No::Worries::Die and No::Worries::Warn).

   OPTION PASSING
       All the functions use the same consistent API with hashes to pass
       options like in:

	 dir_make("/tmp/some/path", mode => 0770);

       This is a bit overkill when only	one option is supported	but it allows
       adding options later without breaking old code.

       The options can also be passed via a hash reference (this can be	useful
       to avoid	data copying):

	 dir_make("/tmp/some/path", { mode => 0770 });

       All the options are checked using Params::Validate.

   SYMBOL IMPORTING
       All the modules are "clean" in the sense	that they do not import	any
       symbol into the caller's	namespace. All the needed symbols (usually
       functions) have to be explicitly	imported like in:

	 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(*);

MODULES
       Here are	the relevant sub-modules and what they provide:

       No::Worries::Date - date	handling:
	   o   date_parse(STRING)

	   o   date_stamp([TIME])

	   o   date_string([TIME])

       No::Worries::Die	- error	handling:
	   o   dief(FORMAT, ARGUMENTS...)

       No::Worries::Dir	- directory handling:
	   o   dir_change(PATH)

	   o   dir_ensure(PATH[, OPTIONS])

	   o   dir_make(PATH[, OPTIONS])

	   o   dir_parent(PATH)

	   o   dir_read(PATH)

	   o   dir_remove(PATH)

       No::Worries::DN - Distinguished Names handling:
	   o   dn_parse(STRING)

	   o   dn_string(DN, FORMAT)

       No::Worries::Export - export control:
	   o   export_control(CALLERPKG, PKG, EXPORT, NAMES...)

       No::Worries::File - file	handling:
	   o   file_read(PATH[,	OPTIONS])

	   o   file_write(PATH[, OPTIONS])

	   o   file_update(PATH[, OPTIONS])

       No::Worries::Log	- logging (log and filter information):
	   o   log_filter(FILTER)

	   o   log_configure(PATH)

	   o   log_wants_error()

	   o   log_wants_warning()

	   o   log_wants_info()

	   o   log_wants_debug()

	   o   log_wants_trace()

	   o   log_error(ARGUMENTS)

	   o   log_warning(ARGUMENTS)

	   o   log_info(ARGUMENTS)

	   o   log_debug(ARGUMENTS)

	   o   log_trace()

	   o   log2std(INFO)

	   o   log2dump(INFO)

       No::Worries::PidFile - pid file handling:
	   o   pf_set(PATH[, OPTIONS])

	   o   pf_check(PATH[, OPTIONS])

	   o   pf_unset(PATH)

	   o   pf_touch(PATH)

	   o   pf_sleep(PATH[, OPTIONS])

	   o   pf_status(PATH[,	OPTIONS])

	   o   pf_quit(PATH[, OPTIONS])

       No::Worries::Proc - process handling:
	   o   proc_output(COMMAND...)

	   o   proc_create(OPTIONS)

	   o   proc_terminate(PROC[, OPTIONS])

	   o   proc_monitor(PROCS[, OPTIONS])

	   o   proc_run(OPTIONS)

	   o   proc_detach([OPTIONS])

	   o   proc_status(STATUS)

       No::Worries::Stat - file	status handling:
	   o   stat_ensure(PATH[, OPTIONS])

	   o   stat_type(MODE)

       No::Worries::String - string handling:
	   o   string_bytefmt(NUMBER[, PRECISION])

	   o   string_escape(STRING)

	   o   string_plural(STRING)

	   o   string_quantify(NUMBER, STRING)

	   o   string_table(TABLE[, OPTIONS])

	   o   string_trim(STRING)

       No::Worries::Syslog - syslog handling:
	   o   syslog_open([OPTIONS])

	   o   syslog_close()

	   o   syslog_sanitize(STRING)

	   o   syslog_debug(FORMAT, ARGUMENTS...)

	   o   syslog_info(FORMAT, ARGUMENTS...)

	   o   syslog_warning(FORMAT, ARGUMENTS...)

	   o   syslog_error(FORMAT, ARGUMENTS...)

	   o   log2syslog(INFO)

       No::Worries::Warn - warning handling:
	   o   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.

GLOBAL VARIABLES
       This module uses	the following global variables (that can all be
       imported):

       $HostName
	   the name of the host	this program runs on (default: derived from
	   Sys::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.

AUTHOR
       Lionel Cons <http://cern.ch/lionel.cons>

       Copyright (C) CERN 2012-2019

perl v5.32.1			  2019-04-03			No::Worries(3)

NAME | SYNOPSIS | DESCRIPTION | PROGRAMMING STYLE | MODULES | ENVIRONMENT VARIABLES | GLOBAL VARIABLES | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=No::Worries&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help