"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ahh-whoops... not the same output as above.
The <> above is grabbing the whole file and reading all the lines into a list. Then reverse is reversing the order of the elements, thus reversing the order of the lines. Then the print for( ) is printing those lines one at a time. So the file is output in reverse, last line first and first line last, but not reversing the characters within the lines. tedrek's code duplicates your functionality, reversing the characters of each line as it is read starting from the first line. Now BrowserUk's code does the same thing as desired above. Except that it wants to crash Perl on any file too lengthy .... (beware the smiling monk who knows the fate awaiting you) In reply to Re: Re: Better Way to Do it 2
by shenme
|
|