Bud, what do you expect to be in $line?
you're declaring it, running a while loop, assigning input to $_, changing
something $line (which holds nothing mind you) then printing $line for every
line you get from <>

in short, i *think* you mean:

while(<>){ s/\s+$//; print }

hth
Jos Boumans

----- Original Message -----
From: "Frank Newland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 10:27 PM
Subject: Trailing spaces ... aka rtrim();


> All,
> I wish to remove trailing spaces..
>
> #!/usr/bin/perl -w
> use strict ;
> my $line  ;
> while (<>)  {
> chomp $_ ;
> $line =~ s/\s+$//; #  remove trailing spaces
> print " $line \n";
> }
>
> My output is equal number of blank lines..
>
> Where is my error?
>
> Frank
>
>

Reply via email to