develooper Front page | perl.perl5.porters | Postings from October 2003

Re: new slurp module

Thread Previous | Thread Next
Steve Hay
October 24, 2003 09:08
Re: new slurp module
Message ID:
Abigail wrote:

>If we add File::Slurp
>to the distribution, we should also add String::ChopChop which replaces
>the two-line idiom
>    $str =~ s/^\s+//;
>    $str =~ s/\s+$//;
>with the two-liner:
>    use String::ChopChop;
>    chopchop ($str);
>After all, it's a common operation, but often done in ugly or inefficient
What's wrong with the one-liner

    $str =~ s/^\s+|\s+$//g;


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