http://qs1969.pair.com?node_id=11121795


in reply to Re^4: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

FYI instead of $line =~ s/\s+$//; # rtrim() in Perl you can use AWK hack is split:

($line)=split(' ',$line,1)

Perhaps I am misunderstanding something but are you saying that $line =~ s/\s+$//; and ($line)=split(' ',$line,1); are equivalent? That doesn't seem to be the case, the latter appearing to implement the ltrim() you desire. This code

use strict; use warnings; my $line = q{ aaa bbb ccc ddd eee fff }; ( $line ) = split( ' ', $line, 1 ); print qq{-->$line<--\n};

produces

-->aaa bbb ccc ddd eee fff <--

Perhaps you could clarify?

Cheers,

JohnGG