saintmike has asked for the wisdom of the Perl Monks concerning the following question:
From the main package, I would like to overwrite a module's
by a different value for nefarious purposes. I trieduse constant VALUE => 1;
but this still prints "1" and not "2". I must be missing something obvious, or is the prototype playing games with me?package A; use strict; use constant VALUE => 1; sub func { print "Constant is ", VALUE, "\n"; } package main; use strict; no strict 'refs'; *{"A::VALUE"} = sub () { 2 }; A->func();
Back to
Seekers of Perl Wisdom