http://qs321.pair.com?node_id=295158


in reply to Worst thing you ever made with Perl

I think the worst things I've ever done was in attempting to write my own content management about 3 years ago. I rolled my own CGI replacement by taking bits of cgi-lib.pl and changing them to suit my needs. My pages would send out a ton of cookies (at least 4, although maximum on one page was 17, I believe). Probably the worst part of it all was that I'd put sql statements in cookies (yes, I know...I'll even give you the bat with which you may beat me in the head). I relied HEAVILY on javascript to do a lot of things such as input checking. I never checked any values coming in because javascript is such a good input checking tool (ah darn, javascript disabled? oops...). There were a few places where I blindly used incoming parameters to execute external scripts. My user authentication scheme worked...sometimes. A lot of times, the system would just let anyone look at what were supposed to be heavily guarded parts of the site. I had a ton of scripts and not a single module in the entire system. I would just call do "file". Each time I reached a critical next step (i.e. the profiles are finally working, yay!) I would print the entire thing out on dead trees. I wouldn't bother keeping old versions because, well, seriously...who wants to go back to the older versions? Half of my variables in any of the scripts were $tempX. The other half would just be $X. I had a couple of variables with somewhat descriptive names, although some contained explicit language because I had problems with the fact that they weren't working correctly at some point. I had a script called util.pl which contained, among other amusing things, a quicksort subroutine, a date subroutine that would call out to the shell, a directory listing subroutine that also called out to the shell, and a subroutine that did almost what grep does. You name an embarassing coding blunder, I probably did it.

But alas, a programmer buddy from Sweden pointed out many of the errors in my ways when I showed him the source. He laughed at me. I was ashamed of my efforts -- all tha time I pissed away doing stupid crap. I buried my print outs in my backyard (along with my sister's tae bo tapes...*shudder*) and decided to learn how to do things the right way. I spent weeks looking at random nodes as well as reading merlyn's articles on his site. This is why I think so highly of him. I've grown to love CPAN and can even quote perldoc with little effort.

...at least that's how I made my way out of the darkness and into the light.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1