diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-09-08 21:47:24 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-09-08 21:47:24 +0000 |
commit | aab6a793686b4f073e16b436e1705cd0e9106ced (patch) | |
tree | 8061e6895affc03639247f7b47fefdb10fc1acb3 /op.c | |
parent | 30c282f60070382cf04eda8175abc90062779e80 (diff) | |
download | perl-aab6a793686b4f073e16b436e1705cd0e9106ced.tar.gz |
Make 'state $$' etc report 'Can't use global $$ in "state"' (not "my")
p4raw-id: //depot/perl@31823
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -363,10 +363,12 @@ Perl_allocmy(pTHX_ const char *const name) { /* name[2] is true if strlen(name) > 2 */ if (!isPRINT(name[1]) || strchr("\t\n\r\f", name[1])) { - yyerror(Perl_form(aTHX_ "Can't use global %c^%c%s in \"my\"", - name[0], toCTRL(name[1]), name + 2)); + yyerror(Perl_form(aTHX_ "Can't use global %c^%c%s in \"%s\"", + name[0], toCTRL(name[1]), name + 2, + PL_parser->in_my == KEY_state ? "state" : "my")); } else { - yyerror(Perl_form(aTHX_ "Can't use global %s in \"my\"",name)); + yyerror(Perl_form(aTHX_ "Can't use global %s in \"%s\"",name, + PL_parser->in_my == KEY_state ? "state" : "my")); } } |