I believe it was Larry who said, "You can write baby Perl and we won't laugh." I like that, and I've adopted it when working with new Perl programmers. We've all seen Perl as written by C programmers or as written by shell programmers. But some code I saw today really takes the cake. I think this is "Perl as written by a non-programmer"...
Here's the beginning, as the script's processing its args:
$size=0;
for (@ARGV)
{
$size=$size+1;
}
for ($i=0; $i < $size; $i++)
{
$argument[$i]=shift(@ARGV);
}
I won't post the part where the code reads the input file twice: once to count the lines, and again to pull it into an array...
I think the programmer just liked two-pass algorithms.
Suspicious (Score:2)
Hey, that looks suspiciously like brian d foy's brace placement style [perl.org]. How long has he been hiding this from us? I, for one, am aghast :)
Re:Suspicious (Score:1)
Re: Suspicious (Score:1)
Hey! Did you ask for my permission to use source-code from my lastest project??
ybiC - the eternal amateur