in reply to Iterate multiple arrays with added text

Have you thought about using hashes? Wouldn't it be a little easier to manage? I once was very confused by them, and I still am depending on how complex the data is, but I know enough to get what I need done... done. I'll leave this here for you to examine :)
use strict; use warnings; use Data::Dumper; # $Data::Dumper::Terse = 1; my %library; #this is where we store title, author, date my $i = 1; #iterator for hash key name while (<DATA>) { my ( $title, $author, $date ) = split /\|/, $_; # the '|' just sep +erates records chomp($date); #because date has newline read from my example push @{ $library{ $i++ } }, $title, $author, $date; #put it in the + hash of arrays '%library' } foreach my $key ( sort { $a <=> $b } keys %library ) { #sort isnt nece +ssary but i put it there to give you an example print "Book #$key\n"; print "Title: @{$library{$key}}[0]\n"; print "Author: @{$library{$key}}[1]\n"; print "Date: @{$library{$key}}[2]\n\n"; } # use Data::Dumper to quickly verify data; # print Dumper %library; __DATA__ Beginning Perl|Simon Cozens|May 25, 2000 Modern Perl|Chromatic|2012 Impatient Perl|Greg London|Feb 7, 2004 Extreme Perl|Robert Nagler|2004 Embedding Perl in HTML with Mason|Dave Rolsky, Ken Williams|Oct 2002
If you want to try out this code, click the download link below and copy/paste.
Have fun learning!