note
johngg
<blockquote><i> FYI instead of $line =~ s/\s+$//; # rtrim() in Perl you can use AWK hack is split:
<p>
<code>($line)=split(' ',$line,1)</code>
</i></blockquote>
<p>Perhaps I am misunderstanding something but are you saying that <c>$line =~ s/\s+$//;</c> and <c>($line)=split(' ',$line,1);</c> are equivalent? That doesn't seem to be the case, the latter appearing to implement the <c>ltrim()</c> you desire. This code</p>
<code>
use strict;
use warnings;
my $line = q{ aaa bbb ccc ddd eee fff };
( $line ) = split( ' ', $line, 1 );
print qq{-->$line<--\n};
</code>
<p>produces</p>
<code>
-->aaa bbb ccc ddd eee fff <--
</code>
<p>Perhaps you could clarify?</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-401112">
<p>Cheers,</p><p>JohnGG</p>
</div></div>
11121538
11121788