Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to do perl -c inside perl?

by dave_the_m (Prior)
on Aug 28, 2012 at 19:55 UTC ( #990320=note: print w/replies, xml ) Need Help??


in reply to How to do perl -c inside perl?

You might be able to get away with something like:
for my $code ('$x+$y', '$x+') { printf "code=[%-5s] syntax=%s\n", $code, eval('return 1; ' . $code) ? "ok" : "bad: $@"; }

But you need to consider the effects of things like BEGIN blocks.

Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990320]
help
Chatterbox?
[choroba]: Re: Modern Perl 4th Edition Perl Cookbook is a very bad cookbook, I wasn't able to finish any dish and the resulting meals were disgusting.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-11-17 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?