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

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

Thread Previous | Thread Next
From:
Konovalov, Vadim
Date:
March 28, 2021 05:59
Subject:
RE: Let's talk about trim() so more
Message ID:
DM5PR1901MB219916AE9973553E670A8BEB8A7F9@DM5PR1901MB2199.namprd19.prod.outlook.com
> From: Christian Walde 
> Nope, the motivation is to replace this:
> 
> $a =~ s/^\s+//; $a =~ s/\s+$//;
> 
> Which is like
> 1600+ times on cpan.
> https://grep.metacpan.org/search?q=%5C%5E%5C%5Cs%5C%2B%5B%5E%5C0%5D%2B%5C%5Cs%5C%2B%5C%24%7C%5C%5Cs%5C%2B%5C%24%5B%5E%5C0%5D%2B%5C%5E%5C%5Cs%5C%2B&qd=&qft=

My CPAN modules do not count: I also use s/^\s+|\s+$/g often 
At the same time I am opposed to having trim as part of perl syntax. (string::trim or another package is better, so it will not conflict, but I doubt I will ever use it)

I don't think I am alone with my view


Thread Previous | 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