what is "use strict" for?

----- Original Message -----
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "bc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "Mel Matsuoka" <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 6:29 PM
Subject: Re: welp?


> On Thu, 19 Jul 2001, bc wrote:
>
> > this did not fix it, changing "=" to "eq" in my if statements...???
> >
> > }
> >   } elsif ($guess eq "toe") {
> >   print ("you guessed it!  good job bossman!<br>");
> >   print ("go read the <a href=http://www.abcnews.com>news</a>");
> >   ) else (
>     ^^^^^^^^
> These parentheses need to be chaged to curly braces.  You also should have
> 'use strict' at the top of your script.  Here's the version of the script
> I got to work.  You should also be careful to make sure you have a proper
> indenting style, or you can lose track of where blocks begin and end.
>
> ------------------------
>
> #!/usr/bin/perl -w
>
> use strict;
> use CGI::Carp qw(fatalsToBrowser);
> #howdy
> use CGI qw(param);
>
>
> print<<end_of_html_start;
> content-type: text/html
>
> <html><head>
> <title>customgame</title>
> </head>
> <body>
> end_of_html_start
>
> my $guess = param("guess");
> my $name = param("name");
> if ($guess eq "") {
>
>     if ($name eq "") {
> print ("hello there, please enter name here:<form method=post
> action=customgame.pl><input type=text name=name><input type=submit
> value=enter></form><br>");
>     } elsif ($name eq "randal") {
> print ("hi, since you're $name , you do not have to guess the
> secret
> word!<br>");
>     } else {
> print ("your not randal, so you have to guess the secret
> word:<form
> method=post action=customgame.pl><input type=text name=guess><input
> type=submit value=enter></form><br>");
> print ("hello there, please enter another name here:<form
> method=post
> action=customgame.pl><input type=text name=name><input type=submit
> value=enter><br>");
>     }
> } elsif ($guess eq "toe") {
>     print ("you guessed it!  good job bossman!<br>");
>     print ("go read the <a href=http://www.abcnews.com>news</a>");
> } else {
>     print ("Wrong! <a href=http://toes.netfirms.com>go</a> again...");
> }
>
> print<<END;
> </body></html>
> END
>
> -- Brett
>    http://www.chapelperilous.net/btfwk/
> ------------------------------------------------------------------------
> Why do so many foods come packaged in plastic?  It's quite uncanny.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to