in reply to Re: (bbfu) Re(5): how to hash this
in thread how to hash this
Forgive me if I'm not much help. I'm pretty tired and I have work to do so I can't spend long on it...
I didn't think about the fact that the records would have different number of lines in them. Am I ok to assume that the first part of the records will all be the same and just have an optional number of sub-recrods (Options)? If so, then are you wanting to save the Option records? If not, then just remove the last like I said and you should be ok (since the while(<FILE>) will slurp up all the Option records as well as the "End Product" and ";" lines; ie: the if block won't match). If you did want to save the Option records, you'll have to put a sub-while loop in just before the push to read in all the Option records. It should have similar logic to the outter while loop.
That said, I'm not sure this is the best way to go about this. I don't really like reads inside the if block because you're not doing any EOF checking on them and you're usurping control from the while. I think you might be better off going with Trimbach's suggestion or, perhaps even better (depending on how you implement it), DeaconBlues' method, both of which use $/, though DeaconBlues' use of it actually make more use of it. (Okay, that last bit didn't make much sense but, like I said, I'm sleepy.)
Anyway, sorry I couldn't help more. Hope you get it. Gotta work. =(
bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (bbfu) Re(7): how to hash this
by malaga (Pilgrim) on Apr 01, 2001 at 09:28 UTC |