in reply to Tie::Handle::CSV dynamically detecting header names
<disclaimer>I commend your desire to make your system flexible and useful, and I'm certainly not a BOFH, but...</disclaimer>
Sometimes, you can just make things too hard on yourself. I'm not saying that this is the case here--but in general, trying to make a system idiot proof is impossible. You can bend over backwards trying to do it, but if the users continually send you any random crap and expect your code to parse it and deliver the messages, neither you nor your clients are going to be happy with the system. In cases similar to this, I simply have the system look at the header, and if it can't find the columns it wants, then send an error EMail telling the client what the problem(s) are, and let them fix the problem and send it again. Since they're using CSV files, they're likely to be generating 'em from Excel, so they can rename the columns appropriately...
Again, I'm not advocating that you frustrate your clients. I'm simply suggesting that sometimes there are situations that can be (1) a time sink, (2) continually frustrating, and (3) anti-profitable. Just make sure that you're not putting yourself in a situation where you're going to have to continually "fix" your code because your user can't give you what the program wants. Been there, done that, got the T-shirt, washed it enough times for the lettering to fade...
...roboticus
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tie::Handle::CSV dynamically detecting header names
by Anonymous Monk on Mar 27, 2009 at 15:29 UTC |