stable(3perl)
๐ stable ๐
okay bestie, so picture this: a manual page that's literally called stable โ for Perl โ and it's all about "Experimental features made easy, once we know they're stable" โจ (that's the NAME section, we're folding it in up top like the little crown it is ๐). Manual name? stable, section 3perl. Perl Programmers Reference Guide. Slay.
โจ VERSION โจ
version 0.036 ๐
๐ธ SYNOPSIS ๐ธ
use stable 'lexical_subs', 'bitwise';
my sub is_odd($value) { $value & 1 }
๐ฆ DESCRIPTION ๐ฆ
So there's this thing called the experimental pragma ๐
and what it does is make it easy to turn experiments on while turning the associated warnings off. If you don't already know what it does, bestie, go read about it, fr fr.
Now. Seeing use experimental in code? Might be scary. And honestly it probably should be! ๐ญ Code that uses experimental features might break later if the perl dev team decides an experiment needs to be altered. But when experiments become stable โ because the developers decide they're a success ๐ โ the warnings attached to them go away. And when that happens, you can generally turn them on with use feature.
Which is great!! ๐ซถ IF you're on a version of perl where the feature you want is already stable. But if you're on an older perl, here's the lil dilemma: you might want to use an experimental feature that still warns, even though there's literally zero risk in using it, because later versions of perl have that feature unchanged and now stable. ๐
Example time, because examples are the moment ๐ซ:
The postderef feature was added in perl 5.20.0. In perl 5.24.0, it was marked stable. Using it would no longer trigger a warning. And the behavior of the feature didn't change between 5.20.0 and 5.24.0. Which means it's perfectly safe to use the feature on 5.20 or 5.22, even though there's a warning.
So in that case you could very justifiably write use experimental 'postderef' โ but the casual reader may still be worried when they see that ๐ฌ. Which is exactly why the stable pragma exists: to turn on experimental features only when it's known that their behavior in the running perl is their stable behavior. iconic tbh.
And listen โ if you try to use an experimental feature that isn't stable or isn't available on the running version of perl, an exception will be thrown ๐. Also take care that you've required the version of stable that you need!
If it's not immediately obvious why, here's a bit of explanation:
stablecomes with perl, starting with perl v5.38.- Imagine that v5.38 adds a feature called
florps. It will stop being experimental in v5.42. - The version of
stablethat comes with perl v5.38 can't know that the florps experiment will succeed, so you can'tuse stable 'florps'on the version of stable ships with v5.38, because it can't see the future! ๐ฎ - You'll need to write
use stable 1.234 'florps'to say that you need version 1.234 of stable, which is when florps became known to stable.
Sure, it's a little weird. But it's worth it! ๐ค The documentation of this pragma will tell you what version of stable you need to require in order to use various features. See below. ๐
At present there are only a few stable features:
bitwiseโ stable as of perl 5.22, available via stable 0.031isaโ stable as of perl 5.32, available via stable 0.031lexical_subsโ stable as of perl 5.22, available via stable 0.031- Lexical subroutines were actually added in 5.18, and their design did not change, but significant bugs makes them unsafe to use before 5.22.
postderefโ stable as of perl 5.20, available via stable 0.031const_attrโ stable as of perl 5.22, available via stable 0.032for_listโ stable as of perl 5.36, available via stable 0.032
๐ SEE ALSO ๐
perlexperiment contains more information about experimental features. go peek, bestie ๐
๐ง AUTHOR ๐ง
Leon Timmermans <fawaka@gmail.com>
๐ COPYRIGHT AND LICENSE ๐
This software is copyright (c) 2013 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, periodt ๐
this is perl v5.44.0, dated 2026-10-17, and yes you read that right โ stable(3perl). no cap, go use your stable features responsibly, 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