use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
package Tie::Hash ;
# if $class already contains "::", don't prefix "DBM_Filter::"
$class = "DBM_Filter::$class" unless $class =~ /::/;
+ no strict 'refs';
# does the "DBM_Filter::$class" exist?
if ( ! defined %{ "${class}::"} ) {
# Nope, so try to load it.
croak "$caller: Cannot Load DBM Filter '$class': $@" if $@;
}
- no strict 'refs';
my $fetch = *{ "${class}::Fetch" }{CODE};
my $store = *{ "${class}::Store" }{CODE};
my $filter = *{ "${class}::Filter" }{CODE};
if (SvROK(sv))
goto wasref;
}
+ if (PL_op->op_private & HINT_STRICT_REFS) {
+ if (SvOK(sv))
+ DIE(aTHX_ PL_no_symref_sv, sv,
+ is_pp_rv2av ? an_array : a_hash);
+ else
+ DIE(aTHX_ PL_no_usym, is_pp_rv2av ? an_array : a_hash);
+ }
if (!SvOK(sv)) {
- if (PL_op->op_flags & OPf_REF ||
- PL_op->op_private & HINT_STRICT_REFS)
+ if (PL_op->op_flags & OPf_REF)
DIE(aTHX_ PL_no_usym, is_pp_rv2av ? an_array : a_hash);
if (ckWARN(WARN_UNINITIALIZED))
report_uninit(sv);
}
}
else {
- if (PL_op->op_private & HINT_STRICT_REFS)
- DIE(aTHX_ PL_no_symref_sv, sv,
- is_pp_rv2av ? an_array : a_hash);
gv = (GV*)gv_fetchsv(sv, GV_ADD, type);
}
}
defined $$x;
EXPECT
Can't use string ("foo") as a SCALAR ref while "strict refs" in use at - line 4.
+########
+# [perl #37886] strict 'refs' doesn't apply inside defined
+use strict 'refs';
+my $x = "foo";
+defined @$x;
+EXPECT
+Can't use string ("foo") as an ARRAY ref while "strict refs" in use at - line 4.
+########
+# [perl #37886] strict 'refs' doesn't apply inside defined
+use strict 'refs';
+my $x = "foo";
+defined %$x;
+EXPECT
+Can't use string ("foo") as a HASH ref while "strict refs" in use at - line 4.