in reply to Embedded Syntax Checker?

Perhaps you can use perl -c. Just from the manpage
-c causes Perl to check the syntax of the program and then exit without executing it. Actually, it will execute "BEGIN", "CHECK", and "use" blocks, because these are considered as occurring outside the execu- tion of your program. "INIT" and "END" blocks, how- ever, will be skipped.
Boris

Replies are listed 'Best First'.
Re: Re: Embedded Syntax Checker?
by Anonymous Monk on Apr 21, 2004 at 16:08 UTC
    Thanks - I was trying to avoid shelling out. perl -c is exactly what I want, but I want to use it as a function, ala:
    perlminusc($str); # syntax check _only_ of $str

    Thanks!


    -- Andy