Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

VSarkiss (704)

VSarkiss
  (email not shown publicly)
Yahoo! ID: vah3sark (Add User, Send Message)

I haven't really taken the time to set this up, but you can look at my home node [perlmonks.org] on Perl Monks.

Journal of VSarkiss (704)

Wednesday September 29, 2004
05:24 PM

Perl as written by ...

[ #21115 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.