> try > > open (INFILE, "<filename.txt") || die "Error opening > filename.txt.$!,stopped"; @array = <INFILE>; close(INFILE); > foreach my $rec (reverse(@array)) { > chomp($rec); > ($a,$b) = split(/\|/,$rec);
Just a litle tip, I think it's not a good idea to use $a and $b variables since Perl uses those for sort() and whatever. > print "<i>$a - $b</i><br>\n"; > }; > > > -----Original Message----- > From: Mark Weisman [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 02, 2003 8:53 AM > To: [EMAIL PROTECTED] > Subject: Reverse Order? > > > I read a text file into HTML for viewing through a webpage, > fairly straight forward. > > Open (INFILE, "<filename.txt") || die "Error opening > filename.txt.$!,stopped"; @array = <INFILE>; Close(INFILE); > Foreach my $rec (@array) { > chomp($rec); > ($a,$b) = split(/\|/,$rec); > print "<i>$a - $b</i><br>\n"; > }; > > This code simply reads the text file, and populates it to the > screen in the line order from the text file. I need to > reverse the order from the text file to the screen. So that > the last entry in the text file appears at the top of the > HTML page? Can anyone help me out? I'm hoping that I can just > do this in the display code, and that I don't have to rewrite > the file writing sequence. > > Sincerely in Christ, > Mark > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]