Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Bug or inconsitency? FQN of Package and sub name identical

by ikegami (Pope)
on Nov 22, 2007 at 19:32 UTC ( #652436=note: print w/ replies, xml ) Need Help??


in reply to Bug or inconsitency? FQN of Package and sub name identical

When barewords are involved like in

print(foo + 2);

Perl must guess at what it means. Perl usually guesses the above means

print(foo(+2));

but if foo's prototype is ($), it'll take that as a hint that you meant

print(foo() + 2);

It's the same for

Foo->method();

Perl usually guesses the above means

"Foo"->method();

but if Foo is a function, it'll take that as a hint that you meant

Foo()->method();

where Foo is presumably a function that returns a class name or an object.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2016-06-30 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (404 votes). Check out past polls.