allow perl "sub{..."

This commit is contained in:
Igor Sysoev 2009-09-15 09:37:16 +00:00
parent 16555b4bb3
commit bbb7f62992

View file

@ -761,7 +761,10 @@ ngx_http_perl_eval_anon_sub(pTHX_ ngx_str_t *handler, SV **sv)
} }
} }
if (ngx_strncmp(p, "sub ", 4) == 0 || ngx_strncmp(p, "use ", 4) == 0) { if (ngx_strncmp(p, "sub ", 4) == 0
|| ngx_strncmp(p, "sub{", 4) == 0
|| ngx_strncmp(p, "use ", 4) == 0)
{
*sv = eval_pv((char *) p, FALSE); *sv = eval_pv((char *) p, FALSE);
/* eval_pv() does not set ERRSV on failure */ /* eval_pv() does not set ERRSV on failure */