Go look at PERL/CGI script movies output now, and think about these issues and coding tasks.
$movieQuote = shift(@record); $record[0] =~ tr/\"//d; # "Good Morning, Vietnam" - bye bye " push(@record, $movieQuote); Recall original order of the fields in the moviesPERL.txt file is as follows: famousLine film LeadActor LeadActress Category After the shift and the push, the order would be: ----- ---- film LeadActor LeadActress Category famousLine $movieQuote = shift(@record); # SHIFT - from the front famousLine push(@record, $movieQuote); # PUSH - on the back famousLine Note that the order of the fields in the array @record would now be: film LeadActor LeadActress Category famousLine Suppose we join the separated elements back together, by tabs, as before they were split and as they are in the file (Tab delimited fields): $rec = join(/\t/, @record); $m[$n++] = $rec; # store the record into an array, say @m. Now if you later do these next two statements, the entire set of database records will be stored in the array @m in descending sorted order, sorted from Z to A by movie name. @m = sort(@m); @m = reverse(@m);