Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Missing $ on loop variable

by robin (Chaplain)
on Dec 02, 2005 at 22:55 UTC ( #513745=note: print w/ replies, xml ) Need Help??


in reply to Missing $ on loop variable

I guess this must be a bug in that particular sub-version of perl. I don't have a copy of 5.6.1 handy to test it on, and it's even possible that Sun shipped a non-standard version.

Does anyone else remember why there's a special error message for missing $ on loop variable, rather than it just being a generic syntax error?

Update: My memory is faulty.


Comment on Re: Missing $ on loop variable
Select or Download Code
Re^2: Missing $ on loop variable
by superfrink (Curate) on Dec 02, 2005 at 23:18 UTC
    There is a comment in the other thread Missing $ on loop variable? about how shell programmers might forget that in Perl the "$" is required.
      That's an interesting idea. Perhaps that's it after all.

      I might be mis-remembering: perhaps it was the @ on the array that was optional? I'm pretty sure it was one of them, but it's been a long time since I've had Perl 4 on my computer.Update It is neither. I must have been thinking of what japhy says.

        The @ and % are optional for a lot of functions: push, pop, shift, unshift, splice, keys, values, each.

        Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
        How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-07-30 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls