develooper Front page | perl.perl5.porters | Postings from February 2022

Re: trim vs trimmed revisited

Thread Previous | Thread Next
From:
David Nicol
Date:
February 25, 2022 18:20
Subject:
Re: trim vs trimmed revisited
Message ID:
CAFwScO-hFTGQawzqUL3_C-9yO5QHmOYoaaQXaZgwZuJUcYwmfA@mail.gmail.com
> Compare:
>
>      my @trimmed = map trim, @strings;   # trim called in array context
>
>      my @trimmed = map { trim( my $trimmed = $_ ); $trimmed } @strings;  #
> trim called in void context
>

Is it set in stone yet that trim takes only one arg (has a ($) prototype)?

Compare:

    my @trimmed = trim @strings;  # handling multiple arguments is
orthogonal to in-place or not

-- 
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

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