From fd909433c74372968d34d9cad8f4458ab60e19b4 Mon Sep 17 00:00:00 2001 From: Vincent Pit Date: Sun, 3 Jan 2010 16:33:35 +0100 Subject: Allow "{sub f}" to compile --- toke.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toke.c') 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)); } -- cgit v1.2.1