Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl and CGI

by sachmet (Scribe)
on Mar 24, 2001 at 00:54 UTC ( #66737=note: print w/replies, xml ) Need Help??


in reply to Perl and CGI

You could always do:
use Net::SMTP; use Data::Dumper; $mdarray = [ [0,1,2], [3,4,5] ]; my $mail = Net::SMTP->new("smtp.server"); $mail->from('Some@from.addr'); $mail->to('your@addr.here'); $mail->data(); $mail->datasend("From: Some\@From.addr\n"); $mail->datasend("To: your\@to.addr\n"); $mail->datasend("Subject: Data from web site\n"); $mail->datasend("Date: " . scalar(localtime()) . "\n\n"); $mail->datasend(Dumper($mdarray)); $mail->dataend(); $mail->quit;
Or, alternately, get rid of the use Data::Dumper, and change the Dumper line to:
foreach my $row (@{$mdarray}) { $mail->datasend("data row: @{$row}"); }
Or even yet:
foreach my $row (@{$mdarray}) { $mail->datasend("item 1: $row->[0]\n"); ... }
Any of those approaches should work.

update: whoops! the remainder of the datasend got put into the from: field. Fixed correctly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://66737]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2021-04-20 19:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?