in reply to Re: Removing spaces, again.
in thread Removing spaces, again.
This is pretty much what he did do, and it doesn't work. It might help to change the regex slightly:my $bit_o_line = substr ($line, 3, 7); $bit_o_line =~ m/^\s*(.*)\s*$/; $BKSIC_MODEL[$i] = $1;
But it's still cumbersome compared to some of the earlier suggestions. If you must do it this way, why not follow the method in the FAQ:my $bit_o_line = substr ($line, 3, 7); $bit_o_line =~ m/^\s*(\S+)\s*$/; $BKSIC_MODEL[$i] = $1;
my $BKSIC_MODEL[$i] = substr ($line, 3, 7); $BKSIC_MODEL[$i] =~ s/^\s+//; $BKSIC_MODEL[$i] =~ s/\s+$//;
buckaduck
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Removing spaces, again.
by McD (Chaplain) on Mar 16, 2001 at 04:13 UTC | |
by buckaduck (Chaplain) on Mar 16, 2001 at 04:46 UTC |