Hi
> Also, I don't understand what you mean by thinking of something "more elaborate"
well for instance, you won't catch all possible syntax errors:
lanx:/tmp$ cat tst.pl
}; $hash = {
lanx:/tmp$ perl -c /tmp/tst.pl
Unmatched right curly bracket at /tmp/tst.pl line 1, at end of line
syntax error at /tmp/tst.pl line 1, near "}"
Missing right curly or square bracket at /tmp/tst.pl line 1, at end of
+ line
syntax error at /tmp/tst.pl line 1, at EOF
/tmp/tst.pl had compilation errors.
lanx:/tmp$ perl
$code = '}; $hash = {';
eval "sub { $code } ";
print $@;
__END__
lanx:/tmp$ perl
$code = '}; $hash = ';
eval "sub { $code } ";
print $@;
__END__
Unmatched right curly bracket at (eval 1) line 1, at end of line
syntax error at (eval 1) line 1, at EOF
you might be interested in my slides from YAPC::EU
http://act.yapc.eu/ye2012/talk/4204
unfortunately ATM I have no time to elaborate deeper... :(
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|