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

Let's talk about trim() so more

Thread Next
From:
Aaron Priven
Date:
March 30, 2021 19:13
Subject:
Let's talk about trim() so more
Message ID:
CCE70869-ECC9-4F79-8A98-E8E47A61E597@priven.com
I look at trim() not in the context just of chomp and chop, but in the context of all the other functions in perl. There are actually very few functions that take only one argument and modify it in place, even those that could conceivably do so, or even those like reverse, sort, abs or int where one could imagine modification-in-place actually being quite useful on occasion. Considering the context of uc, fc, sort, abs, reverse, chr, int, etc. to me shows that chomp and chop are weird outliers, and should not be used as models.

-- 
Aaron Priven, aaron@priven.com, www.priven.com/aaron


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