Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^10: Constant subroutine main::C redefined

by BrowserUk (Patriarch)
on Sep 10, 2012 at 14:37 UTC ( [id://992772]=note: print w/replies, xml ) Need Help??


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

It works in main, but the target won't always be main. Still trying to get the syntax right for an arbitrary package.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

/divp align=right
  • Comment on Re^10: Constant subroutine main::C redefined

Replies are listed 'Best First'.
Re^11: Constant subroutine main::C redefined
by tinita (Parson) on Sep 10, 2012 at 17:26 UTC
    no strict "refs"; my $p = "main"; delete ${ $p."::" }{C};
Re^11: Constant subroutine main::C redefined
by kennethk (Abbot) on Sep 10, 2012 at 16:40 UTC
    String eval for sub definition might be helpful here, though I don't know if that messes with the optimization. Minus that,
    sub FOO(){23}; BEGIN{eval sprintf 'delete $%s::{FOO}', __PACKAGE__} sub FOO(){42};
    might hit your need.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found