in reply to Reversing (the) reading of a file.

Here's one way to do (what I think) you want to do:

#!/usr/bin/perl -w use strict; # Grab each line in reverse order open (NEWS, "<news.dat") or die "Can't open news file: $!"; my @articles = reverse <NEWS>; close(NEWS); # Your column names, in the order they appear in the file my @colNames = qw(created_time title date); # Store the contents of the file in a data structure (array of hashref +s) my @table = (); foreach my $article (@articles) { chomp $article; my @vals = split /\|/, $article; # Assign each value to its column name, in a hash my %row = (); foreach my $col (@colNames) { $row{$col} = shift @vals; } # Add this row to the table, as a hashref push @table, \%row; }

Once it's in the table, perlref will help you get what you need out of it. :)