switch (type) {
case VAR_SCALAR:
- /* XXX: something weird is going on here - apparently values can
- * be SVt_NULL but also be SvROK (and also, SVt_NULL isn't SvOK) */
- if (sv_type == SVt_NULL)
- return 1;
- return SvROK(value) ? SvOK(SvRV(value)) : SvOK(value);
+ return sv_type != SVt_PVAV && sv_type != SVt_PVHV &&
+ sv_type != SVt_PVCV && sv_type != SVt_PVFM &&
+ sv_type != SVt_PVIO;
case VAR_ARRAY:
return sv_type == SVt_PVAV;
case VAR_HASH:
"can add PVIV values");
is(exception { $Bar->add_symbol('$bar', \$bar) }, undef,
"can add PVNV values");
+is(exception { bless \$bar, 'Foo'; $Bar->add_symbol('$bar2', $bar) }, undef,
+ "can add PVMG values");
+is(exception { $Bar->add_symbol('$baz', qr/foo/) }, undef,
+ "can add regex values");
+is(exception { undef $bar; $Bar->add_symbol('$quux', \$bar) }, undef,
+ "can add undef values that aren't NULL");
use_ok('CompileTime');