summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-03-09 02:50:43 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-03-09 02:50:43 +0000
commitdce40276d967c484e2b36928ff656a2f5ac3647a (patch)
tree5a7a4331d83df376ce10fbc65d9dba6ab3f2972f /op.c
parent1c17f625523fe31dcefb5b6c09a3c176ed0875fc (diff)
downloadperl-dce40276d967c484e2b36928ff656a2f5ac3647a.tar.gz
use yyerror() instead of croak() so that compile-time failures in
my(LIST) don't confuse globals with lexicals p4raw-id: //depot/perl@3097
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/op.c b/op.c
index 560a50ed2d..88680579b8 100644
--- a/op.c
+++ b/op.c
@@ -147,7 +147,7 @@ pad_allocmy(char *name)
name[2] = toCTRL(name[1]);
name[1] = '^';
}
- croak("Can't use global %s in \"my\"",name);
+ yyerror(form("Can't use global %s in \"my\"",name));
}
if (ckWARN(WARN_UNSAFE) && AvFILLp(PL_comppad_name) >= 0) {
SV **svp = AvARRAY(PL_comppad_name);
@@ -170,7 +170,8 @@ pad_allocmy(char *name)
sv_setpv(sv, name);
if (PL_in_my_stash) {
if (*name != '$')
- croak("Can't declare class for non-scalar %s in \"my\"",name);
+ yyerror(form("Can't declare class for non-scalar %s in \"my\"",
+ name));
SvOBJECT_on(sv);
(void)SvUPGRADE(sv, SVt_PVMG);
SvSTASH(sv) = (HV*)SvREFCNT_inc(PL_in_my_stash);