Next: Portability   Previous: Line indentation in tagged examples   Contents: Contents

Variable assignments do not work

Question:

I wrote a paragraph like


  $var = 120

to assign 120 to $var, but when I used it like in


  The variable was set to $var.

$var was not replaced by the value.

Answer:

Just remove the spaces around the "=":


  $var=120

Discussion:

Because PerlPoint::Parser has to recognize PerlPoint controls amidst natural language it cannot handle whitespaces as programming language parsers do - whitespaces are real tokens. Not accepting them in an assignment simplifies the parsers paragraph type detection.

Next: Portability   Previous: Line indentation in tagged examples   Contents: Contents