steves has asked for the wisdom of the Perl Monks concerning the following question:
This observation was provided by a co-worker. He and I were both surprised that this worked as it does:
produces:use strict; use warnings; my $s = 'foo'; print "s=$ s\n";
But I would have expected this to be consistent and it's not:s=foo
produces:use strict; use warnings; my @a = (qw/a b c def/); my $s = "foo"; print "s=$ s, a=@ a\n";
s=foo, a=@ a
Is there a defined rule for the whitespace allowed between a variable's type identifier and its name? Or is this just an anomoly of variable interpolation in quoted strings?
|
---|
Replies are listed 'Best First'. | |
---|---|
Use B::Deparse to see why
by htoug (Deacon) on Sep 23, 2004 at 14:05 UTC | |
by merlyn (Sage) on Sep 23, 2004 at 14:13 UTC | |
by tye (Sage) on Sep 23, 2004 at 16:21 UTC | |
by merlyn (Sage) on Sep 23, 2004 at 16:23 UTC | |
by dragonchild (Archbishop) on Sep 23, 2004 at 14:11 UTC | |
Re: Surprising whitespace behavior
by QM (Parson) on Sep 23, 2004 at 18:21 UTC | |
by tye (Sage) on Sep 23, 2004 at 19:53 UTC | |
cool - 1 column programming
by fglock (Vicar) on Sep 23, 2004 at 20:21 UTC |
Back to
Seekers of Perl Wisdom