M
Mark Hobley
I have some information that states that the if conditional can be be inverted
from the traditional syntax
if (EXPRESSION) BLOCK
to an alternative syntax:
if BLOCK (EXPRESSION);
I have a simple line of code:
if ($guess == 6) { print 'Wow! Lucky Guess!'; }
However, when I try to invert this, I get a syntax error:
{ print 'Wow! Lucky Guess!'; } if ($guess == 6); # Syntax error
Why does this not work?
The example is academic, and I don't intend to code with the inverted syntax.
I am just trying to get an understanding for the purpose of producing
documentation.
Thanks in advance to anyone who can help.
Regards,
Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Telephone: (0121) 247 1596
International: 0044 121 247 1596
Email: markhobley at hotpop dot donottypethisbit com
http://markhobley.yi.org/
from the traditional syntax
if (EXPRESSION) BLOCK
to an alternative syntax:
if BLOCK (EXPRESSION);
I have a simple line of code:
if ($guess == 6) { print 'Wow! Lucky Guess!'; }
However, when I try to invert this, I get a syntax error:
{ print 'Wow! Lucky Guess!'; } if ($guess == 6); # Syntax error
Why does this not work?
The example is academic, and I don't intend to code with the inverted syntax.
I am just trying to get an understanding for the purpose of producing
documentation.
Thanks in advance to anyone who can help.
Regards,
Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Telephone: (0121) 247 1596
International: 0044 121 247 1596
Email: markhobley at hotpop dot donottypethisbit com
http://markhobley.yi.org/