Second, I managed to leave two pots of water on the stove and not realize I had done so for over half an hour tonight. Or was it three?
I found out why my script, now that I did my hokey little work around (more on that momentarily), managed to increment the cart to 4 when there were only 2 available on the shelf. I forgot to subtract $got from $want before I updated the cart line.
Okay, hokey work-around time. I found out that what I had been using before,
won't create nonexisting files. That's why the script was always crashing right after the logo and search box; it was checking for a file, not finding it, and wasn't able to create it.
Clearly, I had somehow been appending to the cart before I was reading the cart, which makes sense in my old transfer model; but in the new one, I have to know how many are in the cart before I can decide where anything's going, so I have to read it first. If it's not there, that presents a problem.
So, in desperation to see the script do something properly again, I just added a call to my cart-appending sub in the cart-reading sub. That's as sloppy as using the mayonnaise knife in the peanut butter jar, but at least I know it's that sloppy now.
Knowing is half the battle, or a third of a muffin, or something, right? So that I can MAKE MONKEYS FAST?