develooper Front page | perl.perl5.porters | Postings from July 2020

Request review for adding a text trim() function to core

Thread Next
From:
Scott Baker
Date:
July 21, 2020 17:59
Subject:
Request review for adding a text trim() function to core
Message ID:
315434c5-1bcd-e3a1-695f-3785fc3535bb@perturb.org
It's been a personal pet peeve of mine that Perl has never had a
*trim()* function in core. After discussion
<https://github.com/Perl/perl5/issues/17952> with Grinnz, Leonerd, and
others we decided to move forward with seeing what it would take to add
it to core. I wrote documentation and tests, and LeoNerd wrote the
actual implementation. Now I'm here soliciting feedback on this feature
before I submit a formal PR.

You can checkout my branch here:
https://github.com/scottchiefbaker/perl5/tree/trim

Once it's built the easier way to test it is: ./perl -Ilib -E 'say
CORE::trim("   Hello world!    ");'

You will get an experimental warning, but the function should work and
remove the whitespace.

- Scottchiefbaker


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About