Not that I'm feeling frustrated unduly - I just think it's undue that I feel frustration about something like this. My code isn't working, and I'm dragging through the process of debugging it. The goal of bedrest looms large ahead as the problems vanish.
First, errors about opening the filehandle - (I'm always so impressed to see my die statement show up, feels like I'm a real programmer, huh huh) no such file. Huh? I just stuck one in there with the other program that...
...oh. Okay, wrong name. I have named the file explicitly because I'm writing this for someone who I know can't type, so I'm trying to save him typing. Besides, if the file were named wrong and I typed the name I thought it was at the command line, it wouldn't have made it through anyway. Name fixed. Run it again.
Open error gone, but what's this? Unquoted string i...? Hm. A little more coding, a little thought upon the matter, and it occurs to me: This is Perl's way of saying "That isn't a variable without a dollar sign, nitwit!" The error and the message are duly noted in my mind and it's a $ for the i. Save, rerun, lessee...
...hmmm. Well, this...hey, this isn't an error! It's just a warning! Let's see how the new file looks...
Ugh.
Okay, I forgot two things. First, the product name can contain spaces. Second, there needed to be a newline on the stuff I print onto the end of the current inventory file.
The upshot of these two errors is three very incomplete lines mashed together. The mashing is but two keystrokes from fixed, with a \n in the proper spot. The spacing is a whole 'nother ball of wax...
"Hey. Maybe you should journal this. It'll help you think straight, which is no mean feat for you period, much less at 2ish in the morning and whacked up on as much caffeine as you can drink. It'll be valuable later, when you need to get back into the debugging mindset."
I am nothing if not a slave to good ideas at the right time. I fire up my net connection and here I am.
All this having been pointed out and saved for posterity(ha), it's time to go back and debug.
More later.