Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 wandering the Monastery: (6)
As of 2014-12-28 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls