Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: 2*pi*$r -- constant function without prototype

by amarquis (Curate)
on May 01, 2008 at 13:27 UTC ( #683922=note: print w/ replies, xml ) Need Help??


in reply to 2*pi*$r -- constant function without prototype

Is there some meaning to unary * that I don't know about (and couldn't find in perlop) that makes this parse this way? Or do unprototyped functions just gobble up anything that vaguely looks like a term?

I tend to use parens zealously and have avoided learning about this kind of thing in the past, I guess it's time to head to the docs and read up.

Edit: Good point Fletch, totally forgot about that. Thanks!


Comment on Re: 2*pi*$r -- constant function without prototype
Replies are listed 'Best First'.
Re^2: 2*pi*$r -- constant function without prototype
by Fletch (Chancellor) on May 01, 2008 at 13:38 UTC

    Its the sigil for GLOBs (e.g. *STDOUT). How's the compiler supposed to know that $r didn't have a reference to a GLOB in it (somewhere else there was a my $r = \*STDOUT)?

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-07-30 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls