Re: lexical warnings question

2009-06-28 Thread David Nicol
On Sun, Jun 28, 2009 at 1:24 AM, Rafael Garcia-Suarez wrote: > No, it's not global : it's a magic variable that points at the current > warnings for the statement being compiled (much like %^H and $^H point > at the pragmas currently in effect at compile time). and "Being Compiled" means all open

Re: lexical warnings question

2009-06-28 Thread Rafael Garcia-Suarez
2009/6/27 Joshua ben Jore : > Uh... yeah, maybe. > > Reading warnings.pm's &import is revealing. Appears the current > package doesn't matter at all - it just writes to ${^WARNING_BITS} > which is global because it is one of those ${^...} variables. No, it's not global : it's a magic variable that

Re: lexical warnings question

2009-06-28 Thread Hans Dieter Pearcey
On Sat, Jun 27, 2009 at 08:46:12AM -0700, Joshua ben Jore wrote: > Without reading B::Hooks::OP::blah to know how it works, I notice > you're calling import from the forcewarn package, not the package you > want to affect. Consider: > > eval " > package $target_package; > warnings->import(

Re: lexical warnings question

2009-06-27 Thread Joshua ben Jore
Uh... yeah, maybe. Reading warnings.pm's &import is revealing. Appears the current package doesn't matter at all - it just writes to ${^WARNING_BITS} which is global because it is one of those ${^...} variables. I dunno. I guess if I knew this B::Hooks thing I could answer reasonably. It's likely

Re: lexical warnings question

2009-06-27 Thread Joshua ben Jore
On Thu, Jun 18, 2009 at 2:11 PM, Jonathan Rockway wrote: > * On Tue, Jun 16 2009, Bill Ward wrote: >> I'm more interested (at $JOB) in global warnings, actually.  Of course >> one can enable those with $^W or "perl -w" and I do, but developers >> ignore the warnings all too often.  Many of our core

Re: lexical warnings question

2009-06-18 Thread Jonathan Rockway
* On Tue, Jun 16 2009, Bill Ward wrote: > I'm more interested (at $JOB) in global warnings, actually. Of course > one can enable those with $^W or "perl -w" and I do, but developers > ignore the warnings all too often. Many of our core modules were > written without warnings enabled, and people a

Re: lexical warnings question

2009-06-17 Thread Ryan Voots
On Tuesday 16 June 2009 20:04:18 Hans Dieter Pearcey wrote: > On Tue, Jun 16, 2009 at 04:29:56PM -0700, Bill Ward wrote: > > I like the Modern::Perl idea. I'm going to see if there's some way I > > can do what it does. > > The hard part is getting it into all your code, not reproducing it > techni

Re: lexical warnings question

2009-06-16 Thread Eric Wilhelm
# from Bill Ward # on Tuesday 16 June 2009 15:08: >I know we're doing all kinds of crazy stuff to __DIE__ and I'm not >sure about __WARN__ but I suspect we may be. You might like to try this as a way to assert that thou shalt not. http://search.cpan.org/dist/Devel-NoGlobalSig This assumes tha

Re: lexical warnings question

2009-06-16 Thread Hans Dieter Pearcey
On Tue, Jun 16, 2009 at 04:29:56PM -0700, Bill Ward wrote: > I like the Modern::Perl idea. I'm going to see if there's some way I > can do what it does. The hard part is getting it into all your code, not reproducing it technically, which is easy: package Fatal::Warnings; use warnings ();

Re: lexical warnings question

2009-06-16 Thread Bill Ward
On Tue, Jun 16, 2009 at 4:14 PM, Ovid wrote: > > - Original Message > >> From: Hans Dieter Pearcey >> >> On Tue, Jun 16, 2009 at 02:39:21PM -0700, Bill Ward wrote: >> > So, do I need to monkey with $SIG{__DIE__} or something? >> >> $SIG{__WARN__} = sub { die @_ }; >> >> Apply more advance

Re: lexical warnings question

2009-06-16 Thread Ovid
- Original Message > From: Hans Dieter Pearcey > > On Tue, Jun 16, 2009 at 02:39:21PM -0700, Bill Ward wrote: > > So, do I need to monkey with $SIG{__DIE__} or something? > > $SIG{__WARN__} = sub { die @_ }; > > Apply more advanced filtering to @_ as desired. Just a quick ack throug

Re: lexical warnings question

2009-06-16 Thread Bill Ward
On Tue, Jun 16, 2009 at 3:01 PM, Hans Dieter Pearcey wrote: > On Tue, Jun 16, 2009 at 02:49:36PM -0700, Bill Ward wrote: >> Arg, I meant to say $SIG{__WARN__} when I wrote the original >> message... sorry.  I was hoping to avoid that, since I think we are >> already messing around with %SIG in our

Re: lexical warnings question

2009-06-16 Thread Hans Dieter Pearcey
On Tue, Jun 16, 2009 at 02:49:36PM -0700, Bill Ward wrote: > Arg, I meant to say $SIG{__WARN__} when I wrote the original > message... sorry. I was hoping to avoid that, since I think we are > already messing around with %SIG in our applications too much as it > is. What would doing *anything* wi

RE: lexical warnings question

2009-06-16 Thread Burak Gürsoy
> -Original Message- > From: william.w...@gmail.com [mailto:william.w...@gmail.com] On Behalf > Of Bill Ward > Sent: Wednesday, June 17, 2009 12:39 AM > To: module-authors@perl.org > Subject: lexical warnings question > > warnings. So, we want to make warnings

Re: lexical warnings question

2009-06-16 Thread Bill Ward
On Tue, Jun 16, 2009 at 2:43 PM, Hans Dieter Pearcey wrote: > On Tue, Jun 16, 2009 at 02:39:21PM -0700, Bill Ward wrote: >> So, do I need to monkey with $SIG{__DIE__} or something? > > $SIG{__WARN__} = sub { die @_ }; > > Apply more advanced filtering to @_ as desired. Arg, I meant to say $SIG{__W

Re: lexical warnings question

2009-06-16 Thread Hans Dieter Pearcey
On Tue, Jun 16, 2009 at 02:39:21PM -0700, Bill Ward wrote: > So, do I need to monkey with $SIG{__DIE__} or something? $SIG{__WARN__} = sub { die @_ }; Apply more advanced filtering to @_ as desired. hdp.

lexical warnings question

2009-06-16 Thread Bill Ward
In the perllexwarn man page, it states that "the scope of the warning pragma is limited to the enclosing block. It also means that the pragma setting will not leak across files (via use, require or do). This allows authors to independently define the degree of warning checks that will be applied to