Level(3)
π Level(3) β Perl::Destruct::Level π
ok so this is the manual page for Perl::Destruct::Level, bestie, and it's genuinely so niche but like... kind of iconic? it lets you mess with perl's internal destruction level, which sounds lowkey terrifying and honestly it kind of is, but we move π
β¨ SYNOPSIS β¨
like, here's the whole vibe:
use Perl::Destruct::Level level => 1;
my $current_destruct_level = Perl::Destruct::Level::get_destruct_level();
that's it. that's the whole thing. so clean πΈ
π¦ DESCRIPTION π¦
okay so basically this module lets you change perl's internal destruction level. no cap.
the default value of the destruct level is 0, and what that means is that perl literally won't bother destroying all its internal data structures β it just lets the OS do the cleanup at exit instead. main character energy honestly, letting someone else handle the mess π
now, for perls that were built with debugging support (-DDEBUGGING), there's an environment variable called PERL_DESTRUCT_LEVEL that lets you control the destruction level. this module? it lets you modify it on non-debugging perls too. slay. very "we don't need the fancy build to have options" of it β¨
the relevant values that perl actually recognizes are 1 and 2. that's it. and if you wanna know exactly what they mean, you gotta go consult your source code yourself β this page is not gonna hold your hand on that one, sorry bestie π
also heads up: some embedded environments might extend the meaning of the destruction level for their own purposes. mod_perl does that, for example. so like... know your environment, iykyk.
β οΈ CAVEATS β οΈ
okay this is the part where we get real π
- this module won't work when it's used from within an
ENDblock. like, at all. don't even try it. - loading the
threadsmodule will set the destruction level to2. (this is so that spawned threads can properly cleanup their objects, which is fair tbh.) - loading modules that load
threadsβ even if they never actually spawn a single thread β will also set the destruction level to2. a common example of such a module isTest::Builder. so like... watch out for that one π«Ά
π AUTHOR π
copyright Β© 2007 Rafael Garcia-Suarez. this program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. iconic of him, honestly π
π SEE ALSO π
perlrunperlhack
go read those if you want the full lore, bestie π
and that's the page!! it's from perl v5.40.0, dated 2023-01-20, and it lives at Level(3) in the User Contributed Perl Documentation section β mwah, thanks for reading, love u, bye ππ¦β¨
π¦ where this page comes from
- epel 10: perl-Perl-Destruct-Level 0.02-35.el10_0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms