develooper Front page | perl.perl5.porters | Postings from March 2012

Re: [perl #111500] Bleadperl v5.15.7-88-g7e4f045 breaksMLEHMANN/common-sense-3.4.tar.gz

Thread Previous | Thread Next
From:
Zefram
Date:
March 6, 2012 03:09
Subject:
Re: [perl #111500] Bleadperl v5.15.7-88-g7e4f045 breaksMLEHMANN/common-sense-3.4.tar.gz
Message ID:
20120306110856.GO3007@lake.fysh.org
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About