diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-14 01:27:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-14 01:27:13 +0000 |
commit | 192587c2153e5b0fa4ed545cdd3fa7fef8fc0d8b (patch) | |
tree | 23c4d17163d0c727b113962137cc49dcb7697c9c /op.c | |
parent | 9740c8380c47f3138ea60459cef1e748515e656d (diff) | |
download | perl-192587c2153e5b0fa4ed545cdd3fa7fef8fc0d8b.tar.gz |
avoid spurious "Useless use of variable" warning on C<our $foo;>
p4raw-id: //depot/perl@4800
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1074,7 +1074,7 @@ Perl_scalarvoid(pTHX_ OP *o) case OP_RV2SV: case OP_RV2AV: case OP_RV2HV: - if (!(o->op_private & OPpLVAL_INTRO) && + if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO)) && (!o->op_sibling || o->op_sibling->op_type != OP_READLINE)) useless = "a variable"; break; @@ -1830,6 +1830,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs) } else if (type == OP_RV2SV || /* "our" declaration */ type == OP_RV2AV || type == OP_RV2HV) { /* XXX does this let anything illegal in? */ + o->op_private |= OPpOUR_INTRO; return o; } else if (type != OP_PADSV && type != OP_PADAV && |