Sys::OutPut 2.1 review

Download
by rbytes.net on

Sys::OutPut is a Perl module to help make output easier. SYNOPSIS usage Sys::OutPut; talk $fmtstr [, @args]; out $

License: Perl Artistic License
File size: 10K
Developer: Alan K. Stebbens
0 stars award from rbytes.net

Sys::OutPut is a Perl module to help make output easier.

SYNOPSIS

usage Sys::OutPut;

talk $fmtstr [, @args];

out $fmtstr [, @args];

put $fmtstr [, @args];

err $fmtstr [, @args];

debug $fmtstr [, @args];

$Sys::OutPut::quiet = $::quiet;

$Sys::OutPut::debug = $::debug;

These subroutines will make generating output to STDOUT and STDERR easier.

All of the routines treat the $fmtstr argument as a printf format string, with @args as the format string arguments.

The talk routine generates output to STDERR only if the variable $Sys::OutPut::quiet is non-null and non-zero.

The out routine generates output to STDOUT, with a newline appended to , if it is not already terminated with one.

The put routine generates output to STDOUT, without any additional trailing newline.

The err routine generates output to STDERR, with a newline appended if needed.

The debug routine generates output to STDERR only if the variable

$Sys::OutPut::debug is non-null and non-zero, which is also returned as the result.

This allows for convenient usages such as in the following example:

sub foo {
...
return if debug "Stopping now.";
...
next if debug "Skipping further processing";
...
}

If not defined by the user, the $Sys::OutPut::quiet and $Sys::OutPut::debug variables are initialized from their corresponding main variables $::quiet and $::debug, respectively, unless they are already defined.

Requirements:
Perl

Sys::OutPut 2.1 search tags