#$body is the reference to the array of lines my $body=$item->body; print @$body; #or foreach my $line (@$body){ print $line; } #### print "5th line=$body->[4]\n";