Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-28 Thread David Cantrell
Michael G Schwern wrote: I realize this might be because rt.cpan.org does not appear to have been sending out ticket emails. The RSS feeds work though. Shame there's no obvious way to sign up to one feed for all my modules, but I have a little shell script which periodically makes sure I'm

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread Michael G Schwern
chromatic wrote: On Monday 26 February 2007 21:20, Michael G Schwern wrote: Case in point... my tests started suddenly warning about UNIVERSAL::isa called as a function in Class::DBI. After spending a bunch of time trying to figure out what the hell was going on and if Redhat introduced some

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread chromatic
On Tuesday 27 February 2007 00:13, Michael G Schwern wrote: If that were so it would only warn when a MockObject is looked at using UNIVERSAL::isa/can() as a function. You really ought to read the code, especially the part where Test::MockObject and UNIVERSAL::isa and UNIVERSAL::can are

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread chromatic
On Tuesday 27 February 2007 13:42, Michael G Schwern wrote: This handily solves your stated purpose of warning the user about MockObjects not being used because of UNIVERSAL::isa mistakes WITHOUT warning the user about EVERY mistaken use of UNIVERSAL::isa. $ perldoc perllexwarn -- c

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread Michael G Schwern
chromatic wrote: On Tuesday 27 February 2007 13:42, Michael G Schwern wrote: This handily solves your stated purpose of warning the user about MockObjects not being used because of UNIVERSAL::isa mistakes WITHOUT warning the user about EVERY mistaken use of UNIVERSAL::isa. $ perldoc

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread chromatic
On Tuesday 27 February 2007 13:58, Michael G Schwern wrote: What is wrong with the proof-of-concept I proposed? The lines: my $real_isa = \UNIVERSAL::isa; ... if( ref $obj and eval { $obj-$real_isa(Test::MockObject) } ) { -- c

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread Fergal Daly
On 27/02/07, chromatic [EMAIL PROTECTED] wrote: On Tuesday 27 February 2007 13:58, Michael G Schwern wrote: What is wrong with the proof-of-concept I proposed? The lines: my $real_isa = \UNIVERSAL::isa; ... if( ref $obj and eval { $obj-$real_isa(Test::MockObject) }

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread chromatic
On Tuesday 27 February 2007 14:25, Fergal Daly wrote: Why not have something like --- package UNIVERSAL::isa; our %care_about; sub import { my $self = shift; @[EMAIL PROTECTED] = (); } sub isa { my ($obj, $class) = @_; # do correct isa stuff warn my warning if (exists

Re: Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-27 Thread Michael G Schwern
Fergal Daly wrote: sub isa { my ($obj, $class) = @_; # do correct isa stuff warn my warning if (exists $care_about{$class}) or (exists $care_about{ref $obj}); Consider what if $obj is a subclass of the class you care about? That should probably get checked, too, as it too overrides

Why UNIVERSAL::(can|isa) Warn (was Re: using $SIG{__DIE__} correctly (if you must))

2007-02-26 Thread chromatic
On Monday 26 February 2007 21:20, Michael G Schwern wrote: Case in point... my tests started suddenly warning about UNIVERSAL::isa called as a function in Class::DBI.  After spending a bunch of time trying to figure out what the hell was going on and if Redhat introduced some new warning or