lanx:/tmp$ cat tst.pl }; $hash = { lanx:/tmp$ perl -c /tmp/tst.pl Unmatched right curly bracket at /tmp/tst.pl line 1, at end of line syntax error at /tmp/tst.pl line 1, near "}" Missing right curly or square bracket at /tmp/tst.pl line 1, at end of line syntax error at /tmp/tst.pl line 1, at EOF /tmp/tst.pl had compilation errors. lanx:/tmp$ perl $code = '}; $hash = {'; eval "sub { $code } "; print $@; __END__ lanx:/tmp$ perl $code = '}; $hash = '; eval "sub { $code } "; print $@; __END__ Unmatched right curly bracket at (eval 1) line 1, at end of line syntax error at (eval 1) line 1, at EOF