How can I compile a Perl script inside a running Perl session?

Posted by Joel on Stack Overflow See other posts from Stack Overflow or by Joel
Published on 2012-06-22T20:32:18Z Indexed on 2012/06/22 21:16 UTC
Read the original article Hit count: 339

Filed under:

I have a Perl script that takes user input and creates another script that will be run at a later date. I'm currently going through and writing tests for these scripts and one of the tests that I would like to perform is checking if the generated script compiles successfully (e.g. perl -c <script>.) Is there a way that I can have Perl perform a compile on the generated script without having to spawn another Perl process? I've tried searching for answers, but searches just turn up information about compiling Perl scripts into executable programs.

© Stack Overflow or respective owner

Related posts about perl