There are several ways to go. If you are really only
concerned with the last empty line, just remove it with:
pop @array; #pop removes the last item of an array
But maybe you want to remove each newline at the end of the
individual items?
chomp foreach( @array ); # the foreach loop 'remembers' the value
Or do you want remove all empty items as well?
chomp foreach( @array );
@array = grep { length } @array; #grep leaves out all items that have
+a 'false' length
If you want, take a look at
grep,
foreach and
length.
Hope this helps,
Jeroen
"We are not alone"(FZ)