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

Re: Let's talk about trim() so more

Thread Previous | Thread Next
Christian Walde
March 27, 2021 00:58
Re: Let's talk about trim() so more
Message ID:
On Sat, 27 Mar 2021 01:53:54 +0100, B. Estrade <> wrote:

> At the end of the day, it seems to me that the real motivation for this is to eliminate this idiom:
> $foo =~ s/^ *//g; # or however YOU do it

Nope, the motivation is to replace this:

$a =~ s/^\s+//; $a =~ s/\s+$//;

Which is like 1600+ times on cpan.

That said, i also recommend asking the author, Scott, for his motivation. :)

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