Datum::Strip(3pm)

πŸ“¦
version 0.1.3 Β· 2 versions
  • 0.1.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.1.3 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Carp::Datum::Strip πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation corner of the internet, where Datum::Strip lives 🫢 (yes the man page header says Datum::Strip(3pm), we're keeping that energy).


🌸 NAME 🌸

Carp::Datum::Strip β€” it strips most Carp::Datum calls lexically. literally its whole personality πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Carp::Datum::Strip qw(datum_strip);

datum_strip("-", "-");
datum_strip($file, "$file.new", ".bak");

πŸ¦‹ DESCRIPTION πŸ¦‹

So this module exports exactly one routine β€” a single icon, a solo main character β€” called datum_strip(), and its whole job is to remove calls to Carp::Datum routines lexically. that's it. that's the mission. ✨

Now, because the stripping happens lexically, there are some restrictions about what's actually supported. ngl, this is the fine print and it matters: unless you follow the conventions documented in Carp::Datum, stripping will be incorrect. no cap. πŸ’€

The general guidelines are:

  • Do not use here documents or generalized quotes (qq) within assertion expression or tags. Write assertions using '' or "", as appropriate. just be normal about it πŸ™ˆ
  • Assertions can be safely put on several lines, but must end with a semi-colon, outside any string. periodt. ✨

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] β€” okay so: 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). so like, no glow-up for the filename unless the write actually worked, bestie πŸ’–

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. that's the vibe check right there πŸ”₯


🌈 AUTHORS 🌈

Christophe Dehaudt and Raphael Manfredi are the original authors. πŸ‘‘ iconic behavior fr fr

Send bug reports, hints, tips, suggestions to Dave Hoover at <squirrel@cpan.org>. he's literally waiting for your emails, be nice πŸ’œ


⭐ SEE ALSO ⭐


and that's the whole page, bestie! this one shipped as perl v5.34.0 dated 2022-06-30 β€” mwah, go strip something responsibly πŸ’…βœ¨πŸ’–