Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Lo, for i am blind

by TVSET (Chaplain)
on May 17, 2003 at 07:30 UTC ( [id://258840]=note: print w/replies, xml ) Need Help??


in reply to Lo, for i am blind

Since pfaut and Limbic~Region did already point out the error, I'd like to add two small comments.
  • Ok, perl allows you to not put braces in if..else constructions, if you have only one line in the block. But please, don't do it. It decreases readability of your code. Indent doesn't help too much. And of course, not putting braces, leads to errors like you just had. :)
  • Use CGI module for HTML generation. You code will look much simplier without all those quoting escaping staff.

Leonid Mamtchenkov aka TVSET

Replies are listed 'Best First'.
Re: Re: Lo, for i am blind
by Anonymous Monk on May 17, 2003 at 09:03 UTC

    Eh-eeeeeert! Wrong. C allows if(test) statement else statement;. Perl does not.

      Oops. :) I assume the code from the OP worked:
      if($on_off eq "on") print "Activated"; else print "Deactivated";
      Never used it myself, though. The world is full of wonders :)

      Leonid Mamtchenkov aka TVSET

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found