Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
but the error message is "Missing $ on loop variable."my %hash = (1,'a',2,'b',3,'c'); foreach keys(%hash) { print }
works just fine.my %hash = (1,'a',2,'b',3,'c'); foreach (keys(%hash)) { print }
Why is the error message about missing dollar signs, not missing brackets?
This is Perl 5.6.1
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Missing $ on loop variable?
by hardburn (Abbot) on Nov 05, 2003 at 20:50 UTC | |
|
Re: Missing $ on loop variable?
by qq (Hermit) on Nov 05, 2003 at 21:59 UTC | |
by Anonymous Monk on Nov 06, 2003 at 02:01 UTC | |
by Cody Pendant (Prior) on Nov 06, 2003 at 03:23 UTC | |
by Anonymous Monk on Nov 07, 2003 at 10:45 UTC | |
by Cody Pendant (Prior) on Nov 07, 2003 at 21:11 UTC | |
|
Re: Missing $ on loop variable?
by Anonymous Monk on Nov 05, 2003 at 20:54 UTC |