stamp1982 has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I need help with my perl code to read from a .txt file and print out in reverse order. Write a Perl program to read a file, and then print its lines in reverse order, the last line first. This is what I have so far but I am stuck and it would not work. What am I missing out
# Open a .txt file open(seq1, "<seq1.txt") or die $!; #Assign open files to arrays my @seq1 = <seq1>; print "@seq1"; print reverse @seq1;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Read reverse from a file
by davido (Cardinal) on Jun 30, 2013 at 23:25 UTC | |
Re: Read reverse from a file
by smls (Friar) on Jun 30, 2013 at 23:30 UTC | |
by stamp1982 (Novice) on Jul 01, 2013 at 00:07 UTC |
Back to
Seekers of Perl Wisdom