in reply to Re: Re: Re: Syntax error with if following eval
in thread Syntax error with if following eval

I think the problem is that the if is seen as a modifier to the eval statement, after which point the {} mucks up the parsing.

You'd get the same error from: print "hahaha\n" if (1) {};

So, in the eval case, perl thinks you want: eval { 1 } if ($@); but finds an extra block.