in reply to Retrieval of e-mail body
So, you get an array reference, which is kind of like an array, but isn't really one unless you "dereference" it. Otherwise, it's just a funny looking scalar that prints out as something like 'ARRAY(0x80f24a0)'.Body The value of this option should be a reference to an array which contains the lines for the body of the message. Each line should be terminated with `\n' (LF). If Body is given then `Mail::Internet' will not attempt to read the body from `ARG' (even if it is specified).
You would certainly want to read up on references.my ($body) = $message->Body(); foreach (@$body) { } # Or, if you prefer: my (@body) = @{$message->Body()}; foreach (@body) { } # Or, furthermore: my ($body) = join ('', @{$message->Body()});
|
|---|