Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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?
[Discipulus]: which node yesterday?
[Discipulus]: i cannot see any link to tye post..
[Lady_Aleena]: Hello.
[marto]: teleconf + coffee, I'll post it in a few mins

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-06-23 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (538 votes). Check out past polls.