my $body = $item->body; # ^ It's important foreach my $line(@$body) { print $line; } ## or for debugging use Data::Dumper; print STDERR Dumper $body;