Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by ysth (Canon)
on Nov 22, 2007 at 16:32 UTC ( #652413=note: print w/replies, xml ) Need Help??


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

Yes, Foo-> compiles to (&Foo())-> if a sub Foo already exists; otherwise it's ("Foo")->:
$ perl -wl sub Foo::new{"new in Foo"} sub Bar::new{"new in Bar"} print "before sub Foo: ", Foo->new; sub Foo {"Bar"} print "after sub Foo: ", Foo->new __END__ before sub Foo: new in Foo after sub Foo: new in Bar
You can disambiguate by saying Foo::->new or "Foo"->new. I prefer the former.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://652413]
help
Chatterbox?
[LanX]: hmm interesting link
[Discipulus]: Eduardo De Filippo explains how to do coffe - ITA

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-01-16 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (149 votes). Check out past polls.