Object which stringifies to empty string
is definitely not the same as empty string (the former is true value
while latter is not).
Yes, except that it is a flawed assumption that folks check for
"truthiness" of $@. In fact any code that does this (if ($@) { ... }) is
arguably wrong. The only correct way to check for an exception is (if
($@ eq '') { ... } ) after an eval just took place. At which point you
are landing straight into the trap that your exception objects are. Here
is a little nonexhaustive search to convince you that the problem is not
just academical [1]
Oh I see. Checking $@ reftype/magic etc is error-prone to use it here and there. It should be $@ eq ''.

Which brings me to your pull request - it can't be accepted as-is. The
case of a ''-stringifying object is not business as usual. Hence the
test you added needs to be tweaked to expect a *dfferent* exception,
saying something like "Your exception thrown blah blah stringifies to
the empty string - this is not ok, fix your exception library. Original
exception was Foo::Bar=HASH(0x9bb77d0)." Or something like that.
I'll eventually fix test and file a bug for Exception::Class


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to