in reply to Remove nulls, or other Chars
Almost right. Try:
@CLEANED = map{ tr/\000//d; $_ } @EMPLOYEES;
But do note that will also modify @EMPLOYEES. If you don't want that, you could do:
@cleaned = @employees; tr/\000//d for @cleaned;
And if you're happy to clean employees in place, omit the copy and operate directly on @employees.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove nulls, or other Chars
by Saved (Beadle) on Apr 01, 2011 at 14:27 UTC |