Good afternoon
I'm writing a test script that tests whether another perl script compiles correctly. If I was on the command line, I'd use perl -c foo.pl. Normally, if I was within a perl script, I'd either slurp the file into a string and eval it, or try eval { require 'foo.pl' } and check $@ for compilation errors
However, in this case, at the end of foo.pl, it enters a long-running loop with while (<>) (it's a Squid redirector script). This means that my test script hangs forever. How can I break out of this loop, and test whether it looked ok?
Thanks
ViceRaid
In reply to Emulating -c within perl by ViceRaid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |