Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
[Your Mother]: I assume you should be ordering online so you don't have to deal with service people. :P
[LanX]: yeah... service people are like alligators.... ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-03-26 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.