in reply to syntax check from within perl

Well, this might not be the solution you are looking for but you could use the `` operator with something like `perl -c $code` then trap the output to see if there is a systax error. I know this is not a really elegant soluation but I think it would work.