Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Constant subroutine main::C redefined

by Corion (Pope)
on Sep 10, 2012 at 12:11 UTC ( #992740=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Constant subroutine main::C redefined
in thread Constant subroutine main::C redefined

Also note that "redefining" a constant does not necessarily do what BrowserUk wants. The constants get inlined, so redefining them only works from that point on:

use constant C => 1; sub c { C }; use constant C => 2; sub d { C }; print c(); # 1 print d(); # 2


Comment on Re^4: Constant subroutine main::C redefined
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2015-07-05 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls