Carp::Datum::Strip - strips most Carp::Datum calls lexically |
Carp::Datum::Strip - strips most Carp::Datum calls lexically
use Carp::Datum::Strip qw(datum_strip);
datum_strip("-", "-"); datum_strip($file, "$file.new", ".bak");
This module exports a single routine, datum_strip(), whose purpose is
to remove calls to Carp::Datum
routines lexically.
Because stripping is done lexically, there are some restrictions about what is actually supported. Unless the conventions documented in the Carp::Datum manpage are followed, stripping will be incorrect.
The general guidelines are:
There are two calls that will never be stripped: VERIFY()
and DTRACE().
The VERIFY()
is meant to be preserved (or DREQUIRE
would have been used).
DTRACE
, when called, will be remapped dynamically to some
Log::Agent
routine, depending on the trace level. See the Carp::Datum manpage
for details.
The interface of the datum_strip()
routine is:
datum_strip
old_file, new_file, [ext]If the optional third argument ext is given (e.g. ``.bak''), then old_file will be renamed with the supplied extension, and new_file will be renamed old_file. Renaming only occurs if stripping was successful (i.e. the new file was correctly written to disk).
The lowest nine ``rwx'' mode bits from old_file are preserved when creating new_file.
Both old_file and new_file can be set to ``-'', in which case STDIN and STDOUT are used, respectively, and no renaming can occur, nor any mode bit propagation.
Returns true on success, undef
on error.
Christophe Dehaudt and Raphael Manfredi are the original authors.
Send bug reports, hints, tips, suggestions to Dave Hoover at <squirrel@cpan.org>.
Carp::Datum(3).
Carp::Datum::Strip - strips most Carp::Datum calls lexically |