|
1 |
| -package builtin 0.018; |
| 1 | +package builtin 0.019; |
2 | 2 |
|
3 | 3 | use v5.40;
|
4 | 4 |
|
@@ -43,6 +43,10 @@ can be requested for convenience.
|
43 | 43 | Individual named functions can be imported by listing them as import
|
44 | 44 | parameters on the C<use> statement for this pragma.
|
45 | 45 |
|
| 46 | +The L<builtin::compat> module from CPAN provides versions of many of these |
| 47 | +functions that can be used on Perl versions where C<builtin> or specific |
| 48 | +functions are not yet available. |
| 49 | +
|
46 | 50 | B<Warning>: At present, many of the functions in the C<builtin> namespace are
|
47 | 51 | experimental. Calling them will trigger warnings of the
|
48 | 52 | C<experimental::builtin> category.
|
@@ -414,15 +418,12 @@ A complete list is in L<perlrecharclass/Whitespace>.
|
414 | 418 |
|
415 | 419 | C<trim> is equivalent to:
|
416 | 420 |
|
417 |
| - $str =~ s/\A\s+|\s+\z//urg; |
| 421 | + s/\A\s+//u, s/\s+\z//u for my $trimmed = $str; |
418 | 422 |
|
419 | 423 | Available starting with Perl 5.36. Since Perl 5.40, it is no longer
|
420 | 424 | experimental and it is included in the 5.40 and higher builtin version
|
421 | 425 | bundles.
|
422 | 426 |
|
423 |
| -For Perl versions where this function is not available look at the |
424 |
| -L<String::Util> module for a comparable implementation. |
425 |
| -
|
426 | 427 | =head2 is_tainted
|
427 | 428 |
|
428 | 429 | $bool = is_tainted($var);
|
@@ -487,4 +488,4 @@ Available starting with Perl 5.40.
|
487 | 488 |
|
488 | 489 | =head1 SEE ALSO
|
489 | 490 |
|
490 |
| -L<perlop>, L<perlfunc>, L<Scalar::Util> |
| 491 | +L<perlop>, L<perlfunc>, L<Scalar::Util>, L<builtin::compat> |
0 commit comments