http://qs1969.pair.com?node_id=683922


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 (Bishop) 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.