Damn(3pm)
π Damn(3pm) β the "unbless your objects" page, bestie edition
okay so. this is a manual page from the User Contributed Perl Documentation collection, and it lives at section 3pm (that's Perl module docs, iykyk). the module is called Acme::Damn and honestly? it ate. let's get into it π«Ά
β¨ NAME β¨
Acme::Damn β 'Unbless' Perl objects. that's it, that's the whole vibe. we are taking the bless out. periodt. π
πΈ SYNOPSIS πΈ
here's the whole serve in action:
use Acme::Damn;
my $ref = ... some reference ...
my $obj = bless $ref , 'Some::Class';
... do something with your object ...
$ref = damn $obj; # recover the original reference (unblessed)
... neither $ref nor $obj are Some::Class objects ...
so you got your plain $ref, you bless it into $obj of Some::Class, you do your little object things, and then β plot twist β damn $obj hands you back the original $ref, unblessed. and after that? neither $ref nor $obj are Some::Class objects anymore. the class said goodbye. π
π₯ DESCRIPTION π₯
Acme::Damn gives you exactly one routine: damn(). you feed it a blessed reference (aka a Perl object), it unblesses it, and hands you back the original reference. it's giving minimalism, it's giving one job done well, we love that for it. π
π EXPORT π
by default, Acme::Damn exports the method damn() straight into your current namespace. and if you want the aliases for damn() (more on those below π¦), you can import them upon request.
π§ Methods π§
damn objectβdamn()takes a single blessed reference as its argument and returns that reference unblessed. but listen. if object is not a blessed reference,damn()willdiewith an error. so don't play. πbless referencebless reference [ , package ]bless reference [ , undef ]β optionally,Acme::Damnwill modify the behaviour ofblessso you can pass an explicitundefas the target package, which then invokesdamn()for you:
use Acme::Damn qw( bless );
my $obj = ... some blessed reference ...;
# the following statements are equivalent
my $ref = bless $obj , undef;
my $ref = damn $obj;
NOTE: the modification of bless is lexically scoped to the current package. it is not global. no cap. π
π Method Aliases π
not everyone likes to damn the same way, or in the same language, and honestly? respect. so Acme::Damn lets you specify any alias on import β as long as that alias is a valid Perl subroutine name, i.e. all characters match \w. slay.
use Acme::Damn qw( unbless );
use Acme::Damn qw( foo );
use Acme::Damn qw( unblessthyself );
use Acme::Damn qw( recant );
little lore drop: Version 0.02 supported a defined list of aliases, and that got replaced in v0.03 by the ability to import any alias for damn(). glow up fr fr. β¨
β οΈ WARNING β οΈ
big one, bestie, read carefully. just like bless doesn't call an object's initialisation code, damn does not invoke an object's DESTROY method. so if your object needs to be DESTROYed? either don't damn it, or call DESTROY before judgement is passed. that's the rule. π
π«Ά ACKNOWLEDGEMENTS π«Ά
thanks to Claes Jacobsson <claes@surfar.nu> for suggesting the use of aliases, and Bo Lindbergh <blgl@cpan.org> for the suggested modification of bless. icons, both of them. π
π SEE ALSO π
bless, perlboot, perltoot, perltooc, perlbot, perlobj. go read them, they're right there, this is your sign. πΈ
π AUTHOR π
Ian Brayshaw, <ibb@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 2003-2016 Ian Brayshaw
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the page!! π
this was perl v5.42.3, dated 2026-08-19, delivered to you with love from the Damn(3pm) corner of the internet. go forth and unbless responsibly, bestie ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: libacme-damn-perl 0.09-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms