# open input file open (INPUTFILE, "mysubdir/myinputfile.txt") || die; while (defined ($line = )) { print $line; } close INPUTFILE; #"die" stops perl program and print error message #Died at filename line x print "\n\n"; #read a entire file and assign it to the list, not a good idea for large file open (INPUTFILE, "mysubdir/myinputfile.txt") || die; @stuff = ; close INPUTFILE; print @stuff; print "\n\n"; foreach (reverse(@stuff)) { #last line first, reverse $temp = $_; chomp $temp; print $temp."\n"; }