in reply to Re^3: An Unreal Perl Hacker!
in thread An Unreal Perl Hacker!
which prints:#!/usr/bin/perl for ($i=0,$i<=5,$i++) { print "FOO\n"; }
no matter what he does. (classic newbie mistake that used to bug me when I was doing C :) He checks a box that says "output is incorrect."FOO FOO FOO
This tells our critter that the code did execute. It's next step is to examine node replies for similar code fragments. Pretty soon (!), it discovers that a for() loop should have ';' instead of ',' as iterator separators, and hands back the code:eval { for (i=0,$i<=5,$i++) { print "FOO\n"; } }; print "'$@'";
A further refinement would have it make a scope declaration pass, and hand back:#!/usr/bin/perl for ($i=0;$i<=5;$i++) { print "FOO\n"; }
#!/usr/bin/perl use strict; use warnings; for (my $i=0;$i<=5;$i++) { print "FOO\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: An Unreal Perl Hacker!
by pajout (Curate) on Oct 14, 2005 at 13:35 UTC | |
by samizdat (Vicar) on Oct 14, 2005 at 13:40 UTC |