![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
difference between 'if (condition) { expression;}' and 'expression if (condition)'by ranjan_jajodia (Monk) |
on Mar 22, 2006 at 14:24 UTC ( #538512=perlquestion: print w/replies, xml ) | Need Help?? |
ranjan_jajodia has asked for the wisdom of the Perl Monks concerning the following question:
Hi, This is probably a simple question but I am unable to find the answer on the internet because the term involved ('if') is very general. Example1: The above code throws the following (expected) error : But, example 2: does not. Could any one please explain the difference between the two usage? Regards, Ranjan UPDATE: I think it might be because of the braces which puts the $var in a inner namespace. Am I right?
Back to
Seekers of Perl Wisdom
|
|