in reply to Is space supposed to be ignored between a sigil and its variable name?
Perhaps you could avoid unexpected behavior by being more deliberate about using interpolating quotes only when you want to interpolate. Otherwise, always use non-interpolating quotes when you do not want to interpolate. The following will set the $bar variable equal to a string containing a literal dollar sign, followed by a number of spaces, followed by the literal string 'foo' (if that is what you really want).
my $bar = '$ foo';
See Quote and Quote like Operators
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is space supposed to be ignored between a sigil and its variable name?
by ruzam (Curate) on Apr 18, 2009 at 16:38 UTC | |
by almut (Canon) on Apr 18, 2009 at 22:01 UTC | |
by Bloodnok (Vicar) on Apr 19, 2009 at 00:17 UTC | |
by Porculus (Hermit) on Apr 19, 2009 at 14:06 UTC |