Lowell Kirsh <> wrote:
> Why does the following not work?
>
> open(FILES, "< musiclist2.txt");
> @files = <FILES>;
> print "unchomped\n";
> print @files;
> print "chomped\n";
> chomp @files;
> print @files;
>
> It gives:
>
> unchomped
> (Cream) - the very best of cream
> (Janis Joplin) - Greatest Hits
> (Jethro Tull) - Heavy Horses
> (Jethro Tull) - Thick As A Brick
> chomped
Chances are that your prompt is overwriting the last line of output:
it won't have a newline at the end, remember. Try adding
print "\n";
on the end.
Ben
--
The cosmos, at best, is like a rubbish heap scattered at random.
- Heraclitus