Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Form Stopped working

by jenlear (Initiate)
on Apr 04, 2017 at 15:53 UTC ( [id://1187010]=note: print w/replies, xml ) Need Help??


in reply to Re: Form Stopped working
in thread Form Stopped working

Very nice catch!! Thank you soon much!

Replies are listed 'Best First'.
Re^3: Form Stopped working
by poj (Abbot) on Apr 04, 2017 at 16:16 UTC

    You might consider making the script more consistent with a variable

    my $emailCC = 'Any Person <anyperson@anywhere.com,nobody@nobody.com,so +mebodyelse@icloud.com>'; print MAIL "To: $emailTo\n"; print MAIL "Cc: $emailCC\n"; . .
    poj
      For situations where you have a stream of lines, a here-doc can significantly improve readability. As well, a two-argument open without a check is considered bad practice. Combining all this with a lexical filehandle and poj's suggestion, I might write your script as:
      my $emailTo = 'Customer Service <customerservice@df-foods.com>'; my $emailCC = 'Frank Simmons <fsimmons@oregonpotato.com,susan@ftiegs.c +om,jenbrink@icloud.com>'; my $emailFrom = FilterCChars($FTGEmail); open(my $mail,'|-', $mailProg) or die "Problem accessing $mailProg: $! +"; print $mail <<EOT; To: $emailTo Cc: $emailCC From: $emailFrom Subject: $emailSubject Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit $emailBody EOT close $mail; # Redirect user to success page print "Location: /thankyou.html\n\n"; exit;
      Note how much cleaner that looks without all the newlines and print commands.

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found