my $str = <<'CODEIMPORT'; # this code block would be dynamic print "Don't run me!\n"; prnt 'Just check me for errors\n": CODEIMPORT # eval $str; # gives a run-time error eval { $str; }; # compiles (?) - but does not check syntax # I just want to check for syntax - # it will evaluated later and in a new/different context # (e.g., passed to a different script)