I have to bring my SO lunch; I have to clean the living room; I have to finish my God Damned Program.
I think I can actually do the last one.
I'm fairly close. Everything's working fine; the thing that removes the AE symbol and replaces it with Ae is in place. (Although I'll admit I jury-rigged it; it just checks if the first character of the name is nonletter and replaces it with Ae. In the long run, that could come back to bite my ass.) It inserts the names into the list peachy keen. Just have to fix duplicates and get it to write the new inventory file now.
Duplicates are actually going to be easier than I thought. There should never be a case where more than one duplicate exists, and there shouldn't be duplicates in the new list, so I just have to foreach element in @newcards and then foreach element in @cards, check if their names match, and if they do, add their stock amounts and write the new line to the @cards.
The problem then: How do I remove the existing line with the previous inventory info?
Answer: I don't. I don't make a new line; I add the values and then replace whatever is between two colons (because there's just the one value between two colons in that array) with the new value. Easy as pie, and shorter in code, I'll bet. Gotta love regular expressions.
Oh, and the new Exegesis(sp?) has me convinced about learning Perl 6 eventually. I like
However, I'd like to be a LOT better with Perl 5 before I go farting around in Perl 6.