I'm getting some strange errors from perl with regards to a Mail::Sender scirpt:

Command died with status 40: "/usr/local/apache/cgi-bin/include/email.pl". Command output: prin +t() on closed filehandle Symbol::GEN0 at /usr/lib/perl5/site_perl/5.6.0/Mail/Sender.pm line 1451. print() o +n closed filehandle Symbol::GEN0 at /usr/lib/perl5/site_perl/5.6.0/Mail/Sen +der.pm line 1907. readline() on closed filehandle Symbol::GEN0 at /usr/lib/perl5/site_perl/5.6.0/Mail/Sender.pm line 109. print() on + closed filehandle Symbol::GEN0 at /usr/lib/perl5/site_perl/5.6.0/Mail/Sen +der.pm line 126. readline() on closed filehandle Symbol::GEN0 at /usr/lib/perl5/site_perl/5.6.0/Mail/Sender.pm line 109. Can't use +an undefined value as a symbol reference at /usr/lib/perl5/site_perl/5.6.0/Mail/Sender.pm line 1451. Issuing r +ollback() for database handle being DESTROY'd without explicit disconnect().

Sender is installed and works properly with other scripts. The script I'm trying to run is quite long so I'll post some pieces:

beginning.... 1 #!/usr/bin/perl -w 2 3 ################### 4 #parts of the script are from the perldesk email.pl file 5 #the rest are my own modifications 6 #Neil Watson Mon Aug 12 10:17:47 EDT 2002 7 ################## 8 9 #scalars from these includes 10 use vars qw($dbhost $dbname $dbuser $dbpass $ticketad $hdtime) +; 11 12 require "/usr/local/apache/cgi-bin/include/conf.pl"; 13 require "/usr/local/apache/cgi-bin/include/lang/en.inc"; 14 15 my ($user, $callemail, $status, $category, $ownership); 16 my ($staffemail, @staffemail, $callid); 17 my ($ref, %global, $sender); 18 19 use strict; 20 use warnings; 21 22 ############## 23 #parse incoming support email 24 ############## 25 26 use MIME::Parser; 27 use MIME::Entity; 28 use MIME::Body; 29 use Mail::Sender; 30 First sender: 60 #if subject is emplty, send reply and stop here 61 if ((!$subject) || ($subject eq "")){ 62 63 $sender = new Mail::Sender; 64 65 $sender->Open({ 66 smtp =>'mail', 67 to =>"$from", 68 from =>"$ticketad", 69 fake_from =>"$ticketad", 70 subject =>"Help Desk Response", 71 headers => "Errors-To: postmaster\@mydomain.com"}); 72 73 $sender->Body; 74 $sender->SendEnc(<<'*END*'); 75 Please resend your request with a subject line intact, if you +are replying to a staff response, please keep the subject line intact for tracking purposes, if this is a new request, please give +it a suitable subject line. 76 77 Thank You, 78 Customer Support 79 *END* 80 $sender->Close; 81 exit; 82 } Sender later on 183 if ($callemail != $from) { 184 185 $sender = new Mail::Sender; 186 187 $sender->Open({ 188 smtp =>'mail', 189 to =>"$from", 190 from =>"$ticketad", 191 fake_from =>"$ticketad", 192 subject =>"Help Desk Submission", 193 headers => "Errors-To: postmaster\@mydomain.com"}) +; 194 195 $sender->Body; 196 $sender->SendEnc(<<'*END*'); 197 Sorry, you seem to have sent this help desk response to a call + which is not owned by you. If you believe this to be a mistake, plea se check that you are sending this response from the email add +ress used when logging this call. 198 199 Thank You, 200 Customer Support. 201 *END* 202 $sender->Close; 203 $dbh->disconnect(); 204 exit; 205 }

Any suggestions would be appreciated.

Neil Watson
watson-wilson.ca


In reply to Mail::Sender error by neilwatson

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.