I have a cgi script written in perl. I have a subroutine which prints out the results from my form data
sub print_details{
print "\nWe have recieved your order for a $pizza_size pizza with ";
&pizza_toppings;
}
Since I want the same results to appear when I send an email, how do I call the subroutine?
I tried print SENDMAIL &print_details; as the code below. But, this has no effect.
# send e-mail
my $sendmail;
$sendmail="/usr/sbin/sendmail -t";
open(SENDMAIL , "| $sendmail") ||die("unable to open");
print SENDMAIL "From: $txt_email\n";
print SENDMAIL "To: abc123@hotmail.com\n";
print SENDMAIL "Reply-To: abc123@hotmail.com \n";
print SENDMAIL "Subject: YOUR PIZZA ORDER\n" ;
print SENDMAIL &print_details;
close (SENDMAIL);
Any suggestions...
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.