Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Mail errors

by Satanya (Novice)
on Sep 06, 2001 at 22:27 UTC ( [id://110685]=perlquestion: print w/replies, xml ) Need Help??

Satanya has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have a cgi script that I have created for my company. In it I need to be able to pull values from a form and mail them to an alias. However, when I compile it I have an error thrown that I do not understand. Any help would be appreciated.

Here is the error I get:

Bareword "MAIL" not allowed while "strict subs" in use at dra_feedback.cgi line 112.

Execution of dra_feedback.cgi aborted due to compilation errors.

Here are the instances of MAIL in my code.

open (MAIL, "|/user/lib/sendmail -t") || Error ("Unable to run mail pr +ogram "); print MAIL <<EOMH; To: $to CC: $cc From: $from Name: $name ############more formating code here######### EOMH Close (MAIL);

The last line of the code, Close (MAIL); is the line 112 where the compiler gives me the error.

Thanks for your time.

Newbie Satanya

Replies are listed 'Best First'.
Re: Mail errors
by blakem (Monsignor) on Sep 06, 2001 at 22:31 UTC
    try close instead of Close. (note the lowercase 'c')

    -Blake

Re: Mail errors
by rchiav (Deacon) on Sep 06, 2001 at 22:33 UTC
    there is no such thing as "Close". There's a "close" though. :)

    Rich

    update: Just to be a little less curt I thought I'd give you some advice on that type of error for the future. What the error means is that there's just some word that it doesn't recognise in your script. You'll get that error if you mean to type $foo, but type foo instead. That's where I most commonly see it. You'll also get it if you typo something like typing chmp instead of chomp. And in your case, it didn't recognize Close.

    The best thing about these "Forhead slapper" errors is that you won't make them again. Well you might accidentially capitalize a word again, but you'll definately catch it :).

      Oky thanks.. another stupid error that i did not catch.

      Thanks again.

      ever learnig Satanya =)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2025-04-23 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.