Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Form Stopped working

by poj (Abbot)
on Apr 04, 2017 at 15:22 UTC ( #1187002=note: print w/replies, xml ) Need Help??

in reply to Form Stopped working

Look very carefully at the quote at the end of this line

'Cc: Frank Simmons <,,>

Replies are listed 'Best First'.
Re^2: Form Stopped working
by jenlear (Initiate) on Apr 04, 2017 at 15:49 UTC
    Ahhhh let me see if it will work now...
Re^2: Form Stopped working
by jenlear (Initiate) on Apr 04, 2017 at 15:53 UTC
    Very nice catch!! Thank you soon much!

      You might consider making the script more consistent with a variable

      my $emailCC = 'Any Person <,,so>'; print MAIL "To: $emailTo\n"; print MAIL "Cc: $emailCC\n"; . .
        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 <>'; my $emailCC = 'Frank Simmons <,susan@ftiegs.c +om,>'; 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.

Re^2: Form Stopped working
by Anonymous Monk on Apr 04, 2017 at 15:37 UTC
    A) Welcome to the monastery, jenlear!
    B) As poj is pointing out, curly quotes (sometimes called "smart quotes") are not the same as straight quotes in Perl. You'll have a lot easier time if you find a programming-oriented text editor program that doesn't change your straight quotes to curly ones. If we knew what OS you were using, maybe we could suggest a good one.
Re^2: Form Stopped working
by stevieb (Canon) on Apr 04, 2017 at 15:25 UTC

    Nice catch!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-01-29 08:35 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (74 votes). Check out past polls.