less(3perl)
π less β the perl pragma where you just... ask for less π
okay bestie, welcome to the manual page for less, aka the third-party Perl module doc in the Perl Programmers Reference Guide. yes it's really called less(3perl). yes it's a whole thing. let's get into it β¨
πΈ NAME πΈ
less β the perl pragma to request less of something π«Ά
like. literally that. you ask the universe for less. no cap.
π SYNOPSIS π
use less 'CPU';
that's it. that's the whole vibe. π
β¨ DESCRIPTION β¨
okay so this is a user-pragma π which means: if you are very lucky, some code you're already using will know that you asked for less CPU usage, or less ram, or less fat, or... honestly we just can't know bestie π. the move here is to consult your documentation on everything you're currently using. go read it. i'll wait. go π
for general suggestions, try requesting "CPU" or "memory" β¨
use less 'memory';
use less 'CPU';
use less 'fat';
and if you ask for nothing in particular? you're asking for less 'please' π₯Ί
use less 'please';
it's giving polite. it's giving demure. it's giving please. iconic honestly.
π FOR MODULE AUTHORS π
<div>so, tea time: less has been sitting in the core as a "joke" module for AGES now, and it never had any real way of communicating any information to anything. like, zero. silence. π</div>
but thanks to Nicholas Clark we now have user pragmas (peep perlpragma), and now less can actually do something πβ¨
you can probably expect your users to be able to guess that they can request less CPU or less memory, or just "less" overall. they're smart like that π§ π
and if the user didn't specify anything at all? that gets interpreted as them having used the "please" tag π«Ά it's up to you to make that useful. no pressure bestie, only a little pressure.
# equivalent
use less;
use less 'please';
π "BOOLEAN = less->of( FEATURE )" π
the class method less->of( NAME ) returns a boolean that tells you whether your user requested less of something π₯
if ( less->of( 'CPU' ) ) {
...
}
elsif ( less->of( 'memory' ) ) {
}
so like. ask and ye shall receive a truthy or falsy value. slay.
π "FEATURES = less->of()" π
if you don't ask for any feature at all, you get back the list of features that the user requested you to be nice to π₯°
and this has the nicest little side effect ever: if you don't respect anything in particular, you can just ask for it and then use it like a boolean β¨
if ( less->of ) {
...
}
else {
...
}
oopβ use it like a boolean. we love a two-for-one.
β οΈ CAVEATS β οΈ
- This probably does nothing. yeah. yeah. i know. π
- This works only on 5.10+ β so if you're on something older, this whole situation is not for you, bestie.
- at least it's backwards compatible in not doing much π« which is... honestly a flex of a different kind.
ngl the caveats section is doing the lord's work here. read them. respect them. they're real.
okay that's the whole page!! less β ask for less, receive vibes, maybe nothing, possibly a boolean π¦ go forth and use less 'please' at everyone you love π
this has been less(3perl), from perl v5.44.0, dated 2026-10-17. mwah π π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND 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