From 71423ca70404f6c8c33584f59e4f4a94dfaa7941 Mon Sep 17 00:00:00 2001 From: Dan Book Date: Tue, 18 Jun 2024 01:05:13 -0400 Subject: [PATCH] builtin: document when each function was first available and stabilized --- lib/builtin.pm | 68 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/lib/builtin.pm b/lib/builtin.pm index 49206bd757cf..0980884359b7 100644 --- a/lib/builtin.pm +++ b/lib/builtin.pm @@ -119,6 +119,10 @@ distinguished boolean value. This gives an equivalent value to expressions like C or C. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 false $val = false; @@ -129,6 +133,10 @@ it to be a distinguished boolean value. This gives an equivalent value to expressions like C or C. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 is_bool $bool = is_bool($val); @@ -144,6 +152,8 @@ or any variable containing one of these results. This function used to be named C. A compatibility alias is provided currently but will be removed in a later version. +Available starting with Perl 5.36. + =head2 inf $num = inf; @@ -152,6 +162,8 @@ This function is currently B. Returns the floating-point infinity value. +Available starting with Perl 5.40. + =head2 nan $num = nan; @@ -160,6 +172,8 @@ This function is currently B. Returns the floating-point "Not-a-Number" value. +Available starting with Perl 5.40. + =head2 weaken weaken($ref); @@ -169,12 +183,20 @@ count of its referent. If only weakened references to a referent remain, it will be disposed of, and all remaining weak references to it will have their value set to C. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 unweaken unweaken($ref); Strengthens a reference, undoing the effects of a previous call to L. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 is_weak $bool = is_weak($ref); @@ -185,6 +207,10 @@ not weak. This function used to be named C. A compatibility alias is provided currently but will be removed in a later version. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 blessed $str = blessed($ref); @@ -192,6 +218,10 @@ currently but will be removed in a later version. Returns the package name for an object reference, or C for a non-reference or reference that is not an object. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 refaddr $num = refaddr($ref); @@ -200,6 +230,10 @@ Returns the memory address for a reference, or C for a non-reference. This value is not likely to be very useful for pure Perl code, but is handy as a means to test for referential identity or uniqueness. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 reftype $str = reftype($ref); @@ -208,6 +242,10 @@ Returns the basic container type of the referent of a reference, or C for a non-reference. This is returned as a string in all-capitals, such as C for array references, or C for hash references. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 created_as_string $bool = created_as_string($val); @@ -231,6 +269,8 @@ strings. For example if( created_as_string $val ) { ... } # this will not execute +Available starting with Perl 5.36. + =head2 created_as_number $bool = created_as_number($val); @@ -260,6 +300,8 @@ serialisation modules such as JSON encoders or similar situations, where language interoperability concerns require making a distinction between values that are fundamentally stringlike versus numberlike in nature. +Available starting with Perl 5.36. + =head2 stringify $str = stringify($val); @@ -282,6 +324,8 @@ overload will return a string that names the underlying container type of the reference, its memory address, and possibly its class name if it is an object. +Available starting with Perl 5.40. + =head2 ceil $num = ceil($num); @@ -289,6 +333,10 @@ object. Returns the smallest integer value greater than or equal to the given numerical argument. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 floor $num = floor($num); @@ -296,6 +344,10 @@ numerical argument. Returns the largest integer value less than or equal to the given numerical argument. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 indexed @ivpairs = indexed(@items) @@ -324,6 +376,10 @@ C loop syntax; as In scalar context this function returns the size of the list that it would otherwise have returned, and provokes a warning in the C category. +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + =head2 trim $stripped = trim($string); @@ -351,7 +407,11 @@ C is equivalent to: $str =~ s/\A\s+|\s+\z//urg; -For Perl versions where this feature is not available look at the +Available starting with Perl 5.36. Since Perl 5.40, it is no longer +experimental and it is included in the 5.40 and higher builtin version +bundles. + +For Perl versions where this function is not available look at the L module for a comparable implementation. =head2 is_tainted @@ -360,6 +420,8 @@ L module for a comparable implementation. Returns true when given a tainted variable. +Available starting with Perl 5.38. + =head2 export_lexically export_lexically($name1, $ref1, $name2, $ref2, ...) @@ -391,6 +453,8 @@ This must be called at compile time; which typically means during a C block. Usually this would be used as part of an C method of a module, when invoked as part of a C statement. +Available starting with Perl 5.38. + =head2 load_module load_module($module_name); @@ -410,6 +474,8 @@ L feature|feature/"The 'module_true' feature">. C can't be used to require a particular version of Perl, nor can it be given a bareword module name as an argument. +Available starting with Perl 5.40. + =head1 SEE ALSO L, L, L