use warnings;
use strict;
-use constant SPURIOUS_VERSION_CHECK_WARNINGS => ($] < 5.010 ? 1 : 0);
+use constant SPURIOUS_VERSION_CHECK_WARNINGS => ( "$]" < 5.010 ? 1 : 0);
BEGIN {
package # hide from pause
# but of course
BROKEN_FORK => ($^O eq 'MSWin32') ? 1 : 0,
- BROKEN_GOTO => ($] < '5.008003') ? 1 : 0,
+ BROKEN_GOTO => ( "$]" < 5.008003 ) ? 1 : 0,
HAS_ITHREADS => $Config{useithreads} ? 1 : 0,
- # ::Runmode would only be loaded by DBICTest, which in turn implies t/
- DBICTEST => eval { DBICTest::RunMode->is_author } ? 1 : 0,
+ DBICTEST => $INC{"DBICTest/Util.pm"} ? 1 : 0,
# During 5.13 dev cycle HELEMs started to leak on copy
# add an escape for these perls ON SMOKERS - a user will still get death
- PEEPEENESS => ( eval { DBICTest::RunMode->is_smoker } && ($] >= 5.013005 and $] <= 5.013006) ),
+ PEEPEENESS => ( eval { DBICTest::RunMode->is_smoker } && ( "$]" >= 5.013005 and "$]" <= 5.013006) ),
SHUFFLE_UNORDERED_RESULTSETS => $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} ? 1 : 0,
OS_NAME => $^O,
};
- if ($] < 5.009_005) {
+ if ( "$]" < 5.009_005) {
require MRO::Compat;
constant->import( OLD_MRO => 1 );
}
die $suberror
}
}
+ elsif (
+ # a ref evaluating to '' is definitively a "null object"
+ ( not $not_blank )
+ and
+ length( my $class = ref $e )
+ ) {
+ carp_unique( sprintf(
+ "Objects of external exception class '%s' stringify to '' (the "
+ . 'empty string), implementing the so called null-object-pattern. '
+ . 'Given Perl\'s "globally cooperative" exception handling using this '
+ . 'class of exceptions is extremely dangerous, as it may (and often '
+ . 'does) result in silent discarding of errors. DBIx::Class tries to '
+ . 'work around this as much as possible, but other parts of your '
+ . 'software stack may not be even aware of the problem. Please submit '
+ . 'a bugreport against the distribution containing %s.',
+
+ ($class) x 2,
+ ));
+
+ $not_blank = 1;
+ }
return $not_blank;
}
}
my $cf = 1;
- while ( ( (caller($cf+1))[3] || '' ) =~ / :: (?:
+ while ( ( (CORE::caller($cf+1))[3] || '' ) =~ / :: (?:
# these are public API parts that alter behavior on wantarray
search | search_related | slice | search_literal
my ($fr, $want, $argdesc);
{
package DB;
- $fr = [ caller($cf) ];
- $want = ( caller($cf-1) )[5];
+ $fr = [ CORE::caller($cf) ];
+ $want = ( CORE::caller($cf-1) )[5];
$argdesc = ref $DB::args[0]
? DBIx::Class::_Util::refdesc($DB::args[0])
: 'non '
my ($fr, $argdesc);
{
package DB;
- $fr = [ caller(1) ];
+ $fr = [ CORE::caller(1) ];
$argdesc = ref $DB::args[0]
? DBIx::Class::_Util::refdesc($DB::args[0])
: undef