summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2010-01-03 16:33:35 +0100
committerVincent Pit <perl@profvince.com>2010-01-03 16:33:35 +0100
commitfd909433c74372968d34d9cad8f4458ab60e19b4 (patch)
treea4c80056370fda124a32dd66e8b887e9fcfa3b32 /toke.c
parent2484dfd45804d90a4c06fd52415df7023397d17d (diff)
downloadperl-fd909433c74372968d34d9cad8f4458ab60e19b4.tar.gz
Allow "{sub f}" to compile
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index cec8ac2903..49509587bd 100644
--- a/toke.c
+++ b/toke.c
@@ -7432,7 +7432,7 @@ Perl_yylex(pTHX)
else if (*s != '{' && key == KEY_sub) {
if (!have_name)
Perl_croak(aTHX_ "Illegal declaration of anonymous subroutine");
- else if (*s != ';')
+ else if (*s != ';' && *s != '}')
Perl_croak(aTHX_ "Illegal declaration of subroutine %"SVf, SVfARG(PL_subname));
}