in reply to Reading a Line into an Array
But maybe you want to remove each newline at the end of the individual items?pop @array; #pop removes the last item of an array
Or do you want remove all empty items as well?chomp foreach( @array ); # the foreach loop 'remembers' the value
If you want, take a look at grep, foreach and length.chomp foreach( @array ); @array = grep { length } @array; #grep leaves out all items that have +a 'false' length
Hope this helps,
Jeroen
"We are not alone"(FZ)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reading a Line into an Array
by grinder (Bishop) on May 31, 2001 at 11:43 UTC | |
|
Re: Re: Reading a Line into an Array
by Chady (Priest) on May 31, 2001 at 11:46 UTC |