P is for Practical | |
PerlMonks |
Re: CGI problemby liverpole (Monsignor) |
on Nov 06, 2011 at 14:36 UTC ( [id://936293]=note: print w/replies, xml ) | Need Help?? |
"...the '==' has to be used for numeric and 'eq' in case of strings."
Yes, '==' for numeric, 'eq' for strings, and '=' for assignments. Years ago, I learned a good trick for avoiding this kind of error: when, in fact, you meant to say:
If you get in the habit of always putting the constant on the left side of the '==' sign: then, if you accidentally drop one of the '=', you'll get an error: I don't usually make the mistake of writing '=' where I meant '==', but whenever I do, thanks to putting the constant on the left side, the compiler now let's me know about it in no uncertain terms! s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|