GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NO::WORRIES (3)

.ds Aq ’

NAME

No::Worries - coding without worries

CONTENTS

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])
No::Worries::Log - logging (log and filter information):
o log_trace()
o log_debug(ARGUMENTS)
o log_info(ARGUMENTS)
o log_warning(ARGUMENTS)
o log_error(ARGUMENTS)
o log_wants_trace()
o log_wants_debug()
o log_wants_info()
o log_wants_warning()
o log_wants_error()
o log_filter(FILTER)
o log_configure(PATH)
o log2std(INFO)
o log2dump(INFO)
No::Worries::PidFile - pid file handling:
o pf_set(PATH[, OPTIONS])
o pf_check(PATH[, OPTIONS])
o pf_touch(PATH)
o pf_unset(PATH)
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])
No::Worries::Stat - file status handling:
o stat_ensure(PATH[, OPTIONS])
o stat_type(MODE)
No::Worries::String - string handling:
o string_escape(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...)

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-2013

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NO::WORRIES (3) 2013-05-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.