Marc Lehmann wrote:
>Now it's my turn to not understand it. common::sense itself does not
>attempt to copy anything, it wants to brutally override everything and set
>it to the warnings set it wishes to have, everything else off.
Your overriding isn't brutal enough. In the fiddling with ^=, you're
attempting to merge your desired warning flags into the existing
${^WARNING_BITS} value, to maintain the existing length. It will be
cleaner and more supported if you don't attempt to maintain any aspect
of the existing value. You should just assign your target value directly
to ${^WARNING_BITS}, brutally overriding the existing value.
Quick demo:
our $w;
{
no warnings;
use warnings "void";
BEGIN { $w = ${^WARNING_BITS}; }
}
sub import { ${^WARNING_BITS} = $w; }
You have a more complex data flow where you perform the capture at build
time and insert it into common/sense.pm as a literal. That doesn't
affect the principle. The crucial part is "${^WARNING_BITS} = $w".
-zefram
Thread Previous
|
Thread Next