develooper Front page | perl.perl5.porters | Postings from February 2021

Re: Looking for someone to adopt adding trim() to core

Thread Previous | Thread Next
Christian Walde
February 15, 2021 14:53
Re: Looking for someone to adopt adding trim() to core
Message ID:
On Mon, 15 Feb 2021 12:44:58 +0100, demerphq <> wrote:

> [...]

Small update for the list, after this discussion was moved to IRC:

The impetus for backcompat stems from demerphq's company having banned outright, making a way to implement it without using feature seemingly the only way to achieve access to it at all.

However, as of 5.16, feature functions are also available in CORE:: as per:

That means this works:

*x = *CORE::fc; x("AA");

That means both of these shim modules would work:

package Trim; BEGIN { *trim = ( $] >= $version ? *scalar::trim : sub { .... } ) };

package Trim; BEGIN { *trim = ( $] >= $version ? *CORE::trim : sub { .... } ) };

Thus demerphq's feature requirement is fulfilled regardless of which implementation is chosen.

That leaves the issue that this needs to work:

use 5.777;
say trim <>;

If the implementation is:
CORE:: - the path is already clear
scalar:: - some work is needed to figure out how to make it happen.

With regards,
Christian Walde

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About