in reply to Re: RegEx needed
in thread Efficient trimming of trailing whitespace from array elements?
Did you mean to make a copy? Just trimming it is better done by a for loop: s/\s+$// for @data;. That fixes the existing array in place and would prevent such abortions as @data = map { s/\s+$//; $_ } @data which are all too likely given your original suggestion.
Fun Fun Fun in the Fluffy Chair
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: RegEx needed
by gjb (Vicar) on Dec 31, 2002 at 16:14 UTC |