I dont really understand how to assign the output of this code to either a variable for each line of output or just one big block variable. Im using Mail::POP3Client if that helps. The output i am looking to assign a variable to is " print "$_\n" if /^(From|Subject):/i;"
my $count = $pop->Count();
if ($count < 0) {
print $pop->Message();
} elsif ($count == 0) {
print "no messages\n";
} else {
print "$count messsages\n\n";
for my $i (1 .. $count) {
foreach ($pop->Head($i)) {
print "$_\n" if /^(From|Subject):/i;
}
print "\n";
}
}