in reply to Adding variables to Spew grammar

...or a little more verbosely stated...

The single quotes, or the q// operator do not let variables or other special metacharacters interpolate. That means that any variable contained within single quotes, or within a q// operator, will be seen as literal text, not as its interpolated value. For example:

my $var = "Hello world\n"; print q/$var/, "\n"; print qq/$var/; __OUTPUT__ $var Hello world

You can read up on the various sorts of quote and quote-like operators, how they work, and how interpolation works, in perlop.


Dave