tony has asked for the wisdom of the Perl Monks concerning the following question:
I can print() to $mailer but I cannot write() to it.
Here are the errors.
Write on closed filehandle at ./format_eg.pl line 77.
Write on closed filehandle at ./format_eg.pl line 78.
Lines 77 and 78 are the two write statements in the code below. The code works on STDOUT and a normal file. Here is the code.
There endeth the question, much thanks in advance if you have some insight/wisdom to share.sub Write_Data{ format STDOUT = @<<<<<<<<<<@<<<<<<<<<<<@<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<< shift(@printrows), shift(@printrows), shift(@printrows), shift(@printrows) . my $To = 'dvmrgn@home.com'; my %mail_header = ('To', $To, 'From', 'webmaster@onlinerenter.com', 'Subject', 'Test of New Clients Report' +); my $mailer = new Mail::Mailer 'smtp', Server=>'smtp.telusplanet.net'; $mailer->open(\%mail_header); my $ofh = select($mailer); $~ = "STDOUT"; write ; write ; $mailer->close; select($ofh); } # End of write_data
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: More Mailer::Mail
by chromatic (Archbishop) on Apr 28, 2000 at 19:55 UTC | |
|
Re: More Mailer::Mail
by tony (Initiate) on May 01, 2000 at 22:04 UTC |