Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-10-10 16:19 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls