Well, if Perl were (more) of a religion and I was at a revival, that's the comment that would be incited by what just happened.
The incoming stock data had been going, all the lines of it, into an array called @stock. I had to add a function for it, but I changed it so that it would be going into the hash called %inventory. It took maybe ten more lines.
And it almost generated NO ERRORS. I changed the thing that handles it, I changed the thing that gets it, and it almost just worked right then. I wanted to cry. It was beautiful.
The one error it *did* generate (which escapes me now) was a nitpicky little thing. I think I forgot a ; on one of the subroutine's new lines. It worked, clean. Just like that.
All the other stuff I had to do with it became six times easier because of that change, and I can follow the data flow through the program more easily now. All because of a hash! :) Good deal.
I also believe I've ironed out how I'll deal with the security concern (someone, I forget who, on Perlmonks pointed out to me the folly of having a hidden file name in the HTML.) Instead of a cart name, they get a session ID, and it's made up of a date, time, and IP. (I really don't have the faintest notion of whether or not this is how real session IDs are done; I'm just doing what comes to mind and calling it a session ID.) When the script needs to deal with the cart, it looks at the session ID and a file called 'carts'. Carts has a bunch of session IDs and a bunch of file names, and through that the file name becomes a variable. The customer never sees it, their browser never touches it, and the script is VERY happy. Cart names are generated randomly (still haven't set that up yet.)
I haven't set ANY of that up yet, really. Just wrote it all down. It looks easy enough, really - a day or two's work, looks like.
(he said with trepidation)
Anyway. This computer goes into the Fedex box December 3rd, whether I like it or not, and gets fixed by the happy-go-lucky types at Hewlett Packard. (I hope.) By then, all my finals will be over, all my work will be done, and I will be ready to go without email for a little over a week.
Until then, I'm...
Just Another Electron Junkie,