in reply to Creating on-the-fly hashes?
Your actual question is answered by just using a hash:
$stuff{$1} = $2;
A deeper point though. If your code has (by your own admission) complex logic and complex conditions then there are good odds that if you step back and rethink it you can find ways to simplify. Try to do that.
Clean code isn't just aesthetic. Most of the money that will be spent on your code is spent in maintainance. Is the logic so messy that it would be hard for someone who did not know the code to figure it out and fix a bug or add a new feature? If so then how hard will it be for you in a month to fix bugs people find or deal with a changing spec?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating on-the-fly hashes?
by Dominus (Parson) on Jan 08, 2001 at 23:50 UTC |