Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Need Bad Code

by SleepyJay (Beadle)
on Nov 15, 2007 at 20:33 UTC ( #651068=perlquestion: print w/replies, xml ) Need Help??
SleepyJay has asked for the wisdom of the Perl Monks concerning the following question:

I'm taking a programming interview soon. I know there will be some Perl debugging. I'm a little bit rusty in Perl--actually, my head is currently filled with C++ instead.

So, I was hoping to find a resource for buggy Perl code. NO! Let me rephrase that...I'm looking for something like the book "How NOT to program in C++" ( I'm fairly certain nothing like that exists for Perl, but maybe there is some web tutorial someone knows about that has some examples to work through?

Maybe there's a Monk out there who feels like creating a few for me...? Or pointing out some on SOPW that were pretty good but straight forward examples? I'll be hunting cool Perl books later tonight, too, so any suggestions are welcome.

And if any of my interviewers are reading this, please ignore the question. 'K? :)


Replies are listed 'Best First'.
Re: Need Bad Code
by goibhniu (Hermit) on Nov 15, 2007 at 21:45 UTC
Re: Need Bad Code
by philcrow (Priest) on Nov 15, 2007 at 20:44 UTC
    Peter Scott has a book, Perl Medic:Transforming Legacy Code ISBN 0201795264. I haven't read that one.


    Update: corrected book's author, thanks to perrin for pointing out the error.

    The Gantry Web Framework Book is now available.
      I have. Highly recommended!


Re: Need Bad Code
by Joost (Canon) on Nov 15, 2007 at 23:28 UTC
Re: Need Bad Code
by ww (Archbishop) on Nov 15, 2007 at 21:54 UTC
    Have you considered going through Worst Nodes?

    Some will be worst for lack of effort; recalcitrant blindness; etc., but I'd bet a nickle that some are there because they contain code with horrendous gaffes.

Re: Need Bad Code
by eyepopslikeamosquito (Chancellor) on Nov 16, 2007 at 09:22 UTC

      Wow, that is some bad code ... it doesn't properly account for leap seconds

        Someone in the comments section of Daily WTF actually said that. I'm not sure it was tongue-in-cheek there.

      <office_space voice="samir">that is...terrible, terrible code Peter</office_space>

Re: Need Bad Code
by CountZero (Bishop) on Nov 16, 2007 at 07:29 UTC
    Doesn't Perl Best Practices have examples of how not to do things?


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Need Bad Code
by Anonymous Monk on Nov 16, 2007 at 14:05 UTC
    bad code? any of these should do

      Haha awesome :-)

Re: Need Bad Code
by sir_lichtkind (Friar) on Nov 16, 2007 at 18:42 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://651068]
Approved by GrandFather
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2018-06-25 18:04 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.