Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

chaoticset
  (email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Tuesday October 02, 2001
03:58 PM

Trial By Accident

[ #853 ]
Oh, okay, so I forgot I had a test in my network class.

Anyway, while I've got network access, I figured I'd drop a few notes in here.

It suddenly has occurred to me that it might have been a hell of a lot easier to have a different separator for the name and the rest of the data (especially if I ever roll this whole bunch of files together into one huge combined inventory/cost file).

I think I have an idea of how to do this. A search in the Perl Cookbook (now that I have the CD Bookshelf version, it's so friggin' easy) revealed that I can dump arrays into hashes. If I make the name of the card the key and the rest of it as a two-element array, I think my problems are over. I can sort with that, I can do pretty much all I need to do with it. (And, despite my whining, I can still work around the problem of my separators. s/// is supposed to be greedy, so I'll do a match for the first string that is a bunch of letters and then a colon, rip that out of the string...no, wait, the best way to do it would be to make it a step in reading the file: Rip each line into three parts, then map that three-element array into one key and one (two-element array) element in the hash. Once that's all mapped, working with the hash itself should be pie.

I hope.

I guess I'm officially back on track; most of what I'm doing tonight is going to be scribblework, not typingwork, so I probably won't post tonight. Got a 7:00 class tomorrow morning. 7:00-9:45 is Discrete Math and then 10:00-11:20 is Statistics. Four hours of nearly continual math, math, math. No wonder I need all that Dew.

Oh, and I have something to scribble *on* now. I can go through a legal pad in about a month, so I've upgraded: I bought a smallish dry-erase board, something I can carry around with me and use like a pad. (Well, except I can't look through my scribbles. Gotta be careful about keeping good things when they come up.) It was over at Staples for ten bucks; worth it, when your legal pad expenses in a year are well into the double digits.

Well, back to the drawing board. ;-)