Forgive me for such a basic question, I'm brand spanking new to Perl and programming 
in general.  

This is from the exercises in "Learning Pearl", chapter 6, exercise 1.

The goal is to reverse the order of all the lines of a specified file.

The very simple answer given in the book is as follows:
print reverse <>;

Fair enough, but I wanted to explore and try a different way, I came up with the 
following which doesn't work...

while (<>) {
@reverselist = reverse <>;
print "@reverselist";
}

This reverses everything, BUT the last line of the given file.  Can someone tell me 
why this pauses on the last line?

Thanks!






_____________________________________________________________
Surf on! Get a free and secure email account and more @ surfOrbit.com
http://www.surfOrbit.com

_____________________________________________________________
Run a small business? Then you need professional email like [EMAIL PROTECTED] from 
Everyone.net  http://www.everyone.net?tag

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to