Código perl:
Ver originalif( $mode eq "BOTH" || $mode eq "EMAIL") {
# Send email order to you...
open (MAIL
,"|$mailprogram"); print MAIL
"To: $youremail\n"; print MAIL
"From: $b_email\n"; print MAIL
"Subject: New Online Order\n"; print MAIL
"A new order has been received. A summary of this order appears below.\n"; print MAIL
"Order Date: $months[$month] $day, $year $hour:$min:$sec \n"; print MAIL
"Bill To: \n"; print MAIL
" $b_first $b_last \n"; print MAIL
" $b_addr \n"; print MAIL
" $b_addr2 \n"; print MAIL
" $b_city, $b_state $b_zip \n"; print MAIL
" $b_phone \n"; print MAIL
" $b_email \n"; print MAIL
"Ship To: \n"; print MAIL
" $s_first $s_last \n"; print MAIL
" $s_addr \n"; print MAIL
" $s_addr2 \n"; print MAIL
" $s_city, $s_state $s_zip \n"; print MAIL
" $s_phone \n"; print MAIL
"Qty Price(\$) Product ID - Product Name\n"; print MAIL
"$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL
"$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL
"$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL
"$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL
"$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL
"$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL
"$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL
"$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL
"$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL
"$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL
"$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL
"$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL
"$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL
"SUBTOTAL: $SUBTOTAL \n"; print MAIL
"TOTAL: $TOTAL \n"; print MAIL
"FREIGHT: $SHIPPING \n"; print MAIL
"Comments: \n"; print MAIL
"$comment \n"; }
if( $mode eq "BOTH" || $mode eq "FILE") {
$csvcomments = $comment;
#$csvcomments =~ s/\"/$csvquote/ig;
open (CSVF
,">>$csvfilename"); print CSVF
"$months[$month] $day, $year $hour:$min:$sec"; print CSVF
"$QUANTITY_1"; print CSVF
"$ADDTLINFO_1"; print CSVF
"$QUANTITY_2"; print CSVF
"$ADDTLINFO_2"; print CSVF
"$QUANTITY_3"; print CSVF
"$ADDTLINFO_3"; print CSVF
"$QUANTITY_4"; print CSVF
"$ADDTLINFO_4"; print CSVF
"$QUANTITY_5"; print CSVF
"$ADDTLINFO_5"; print CSVF
"$QUANTITY_6"; print CSVF
"$ADDTLINFO_6"; print CSVF
"$QUANTITY_7"; print CSVF
"$ADDTLINFO_7"; print CSVF
"$QUANTITY_8"; print CSVF
"$ADDTLINFO_8"; print CSVF
"$QUANTITY_9"; print CSVF
"$ADDTLINFO_9"; print CSVF
"$QUANTITY_10"; print CSVF
"\$$PRICE_10"; print CSVF
"$ADDTLINFO_10"; print CSVF
"$QUANTITY_11"; print CSVF
"\$$PRICE_11"; print CSVF
"$ADDTLINFO_11"; print CSVF
"$QUANTITY_12"; print CSVF
"\$$PRICE_12"; print CSVF
"$ADDTLINFO_12"; print CSVF
"$QUANTITY_13"; print CSVF
"\$$PRICE_13"; print CSVF
"$ADDTLINFO_13"; }
# Send email conformation to the customer.....
open (MAIL
,"|$mailprogram"); print MAIL
"To: $b_email\n"; print MAIL
"Subject: Order Confirmation\n"; print MAIL
"A new order has been received. A summary of this order appears below.\n"; print MAIL
"Order Date: $months[$month] $day, $year $hour:$min:$sec \n"; print MAIL
"Bill To: \n"; print MAIL
" $b_first $b_last \n"; print MAIL
" $b_addr \n"; print MAIL
" $b_addr2 \n"; print MAIL
" $b_city, $b_state $b_zip \n"; print MAIL
" $b_phone \n"; print MAIL
" $b_email \n"; print MAIL
"Ship To: \n";
if ( $s_addr eq "" ) {
print MAIL
" Use Billing Address\n"; } else {
print MAIL
" $s_first $s_last \n"; print MAIL
" $s_addr \n"; print MAIL
" $s_addr2 \n"; print MAIL
" $s_city, $s_state $s_zip \n"; print MAIL
" $s_phone \n"; }
print MAIL
"Qty Price(\$) Product ID - Product Name\n"; print MAIL
"$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL
"$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL
"$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL
"$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL
"$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL
"$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL
"$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL
"$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL
"$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL
"$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL
"$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL
"$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL
"$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL
"SUBTOTAL: $SUBTOTAL \n"; print MAIL
"TOTAL: $TOTAL \n"; print MAIL
"FREIGHT: $SHIPPING \n"; print MAIL
"Comments: \n"; print MAIL
"$comment \n"; print "Content-type: text/html\n\n"; @LINES = <HEAD>;
print "<h2>Thank you</h2>"; print "Thank you for your order from our online store. You will receive a confirmation email of your order "; print "momentarily. Please contact us at $youremail if you have any questions or concerns."; print "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
@LINES = <FOOT>;