---
name: "Carp::Datum::Strip"
section: "3pm"
platform: "linux"
package: "libcarp-datum-perl"
version: "1:0.1.3-9"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Carp::Datum::Strip"
---

# Carp::Datum::Strip(3pm)

strips most Carp::Datum calls lexically

## NAME

Carp::Datum::Strip - strips most Carp::Datum calls lexically

## SYNOPSIS

```
 use Carp::Datum::Strip qw(datum_strip);
 datum_strip("-", "-");
 datum_strip($file, "$file.new", ".bak");
```

## DESCRIPTION

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 Carp::Datum are followed, stripping will be incorrect.

The general guidelines are:

- •

  Do not use here documents or generalized quotes (qq) within  assertion expression or tags.  Write assertions using '' or "", as appropriate.

- •

  Assertions can be safely put on several lines, but must end with a semi-colon, outside any string.

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 Carp::Datum for details.

## INTERFACE

The interface of the **datum\_strip()** routine is:

- "datum\_strip" *old\_file*, *new\_file*, \[*ext*\]

  The *old\_file* specifies the old file path, the one to be stripped. The stripped version will be written to *new\_file*.

  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.

## AUTHORS

Christophe Dehaudt and Raphael Manfredi are the original authors.

Send bug reports, hints, tips, suggestions to Dave Hoover at \<squirrel@cpan.org\>.

## SEE ALSO

**Carp::Datum**(3).
