You might want to use Deparse to show you the reduced syntax, this will produce slightly prettier output, which might help you a little.
# bad perl
print $foo; s/dog/cat/gm; m%foo%;
FOO: for ($foo) { /dog/ && do {last FOO}; /cat/ && do {$dog = 'rabbit'
+};}
exit(0) or die "wooot?";
When run through Deparse:
bash-2.03$ perl -MO=Deparse badperl.pl
badperl.pl syntax OK
print $foo;
s/dog/cat/gm;
/foo/;
FOO: foreach $_ ($foo) {
if (/dog/) {
last FOO;
}
if (/cat/) {
$dog = 'rabbit';
}
}
die 'wooot?' unless exit 0;
As you can see, some bits get clearer, while others get a little more murky, but it's a useful tool.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.