boom has asked for the wisdom of the Perl Monks concerning the following question:
I just discovered that perl ignores space between the sigil and its variable name and was wondering if someone could tell me if this was the expected behaviour. I've never run into this before and it can result in strange behaviour inside of strings. For example, in the following code, $bar will end up with the value 'foo':
my $foo = 'foo';<br/> my $bar = "$ foo";<br/> <p>This also works with variable declarations:</p> <code>my $ bar = "foo\n"; print $bar;
The second case doesn't really matter much to me but in the case of string interpolation this can lead to very confusing behaviour. Anyone know anything about this?
|
|---|