"\t(Maybe you should just omit the defined()?)\n");
break;
case OP_RV2HV:
- /* This is needed for
- if (defined %stash::)
- to work. Do not break Tk.
- */
- break; /* Globals via GV can be undef */
case OP_PADHV:
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"defined(%%hash) is deprecated");
q(Insert a non-GV in a stash, under warnings 'once'),
);
-ok( !defined %oedipa::maas::, q(stashes aren't defined if not used) );
-ok( !defined %{"oedipa::maas::"}, q(- work with hard refs too) );
+{
+ no warnings 'deprecated';
+ ok( !defined %oedipa::maas::, q(stashes aren't defined if not used) );
+ ok( !defined %{"oedipa::maas::"}, q(- work with hard refs too) );
-ok( defined %tyrone::slothrop::, q(stashes are defined if seen at compile time) );
-ok( defined %{"tyrone::slothrop::"}, q(- work with hard refs too) );
+ ok( defined %tyrone::slothrop::, q(stashes are defined if seen at compile time) );
+ ok( defined %{"tyrone::slothrop::"}, q(- work with hard refs too) );
-ok( defined %bongo::shaftsbury::, q(stashes are defined if a var is seen at compile time) );
-ok( defined %{"bongo::shaftsbury::"}, q(- work with hard refs too) );
+ ok( defined %bongo::shaftsbury::, q(stashes are defined if a var is seen at compile time) );
+ ok( defined %{"bongo::shaftsbury::"}, q(- work with hard refs too) );
+}
package tyrone::slothrop;
$bongo::shaftsbury::scalar = 1;
# now tests in eval
-ok( !eval { defined %achtfaden:: }, 'works in eval{}' );
-ok( !eval q{ defined %schoenmaker:: }, 'works in eval("")' );
+ok( !eval { no warnings 'deprecated'; defined %achtfaden:: }, 'works in eval{}' );
+ok( !eval q{ no warnings 'deprecated'; defined %schoenmaker:: }, 'works in eval("")' );
# now tests with strictures
{
use strict;
+ no warnings 'deprecated';
ok( !defined %pig::, q(referencing a non-existent stash doesn't produce stricture errors) );
ok( !exists $pig::{bodine}, q(referencing a non-existent stash element doesn't produce stricture errors) );
}