This is an unusual question, but here goes. I'll ask the question generally, and then provide a little more info below.
The question: What are some common Perl bugs--specifically related to control flow and/or pattern matching--that tend to cause run time errors or simply incorrect output? It's a long story, but I'm testing out someone's debugging abilities, and I'd like to insert a bug in my own code and see if she can weed it out.
More about my code:
I have a script that reads a logfile for my company's web page and computes various statistics for each user based on the types of pages the user has visited.
The log is a textfile which is made of lines that look like this:
UserIPAddress <tab>Unix system time<tab>URL
So the program reads the text file line by line. While doing so, it uses some pattern matching expressions to check what part of the site each URL belongs to, and then computes the total amount of time each visitor spends on different parts of the site.
I realize that this is very general, and that any answers will also be quite general as a result. I'd appreciate any suggestions that you may have given this general info.
Thanks!
Anna