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

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

Thread Previous | Thread Next
L A Walsh
November 18, 2020 08:16
Re: Looking for someone to adopt adding trim() to core
Message ID:
On 2020/11/05 10:09, Scott Baker wrote:
> Team:
> I lack the time and expertise to complete the PR I started 
> <> to add `trim()` to core.
    To be clear, what is 'trim' supposed to do in perl?

    When I do a 'man trim', I see what looks like a trim in the
textutil::trim, but it looks like it might be related to Tcl?

    Either way, does it take 1 or 2 params, like shown for

  trim "string", Regexp;

Where to trim whitespace, you might have:

  trim "string", m{\s};

But in trim, it shows related trim functions:

Does trim, by itself, only trim the <??> at beginning or end or both?
Is it intended to take a Regex, or is it only used to trim spaces, or
what is the intended functionality?

If it deletes before + after, would that imply a need (at least)
for right+left trims?

I looked at your link, but didn't intended functionality.

Should I assume the trim there is of the same variety?

    ::textutil::trim::trim string ?regexp?
      Remove in string any leading and trailing substring according to
      the  regular  expression  regexp  and return the result as a new

Does that imply variations on the function might also be needed?

Sorry, I'm guessing there is some standard definition and maybe I accidently
hit on it, but just trying to make sure. 


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