There isn't a really good way to do this within Perl . . . however, if you absolutely must double check, you can execute perl from within your program on a temp file containing the source, using the -c switch. But you don't want to do that.
Cheers,Update: Chmrr makes a good point about BEGIN blocks . . . see below
In reply to Re: Can you check the syntax of a eval() before executing it?
by erikharrison
in thread Can you check the syntax of a eval() before executing it?
by slloyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |