in reply to Re: clean code
in thread clean code
For most casual applications, I usually use split(/\s*=\s*/, $pair, 2). I like spaces. I'd do the same for the semicolon split. But considering the comment (this is from a serialized db row), I doubt there's much point.
To be more robust (specifically: to allow arbitrary characters in the names and values), I agree with the suggestions to use URI escaping. Since you're programmatically generating the data you're parsing, there's no reason not to do the job right -- your first concern should be correctness, second should be basic human readability (so you can tell what's going on), and a very distant third should be human writability (for debugging, casual testing, off-the-cuff model manipulation, etc.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: clean code
by creamygoodness (Curate) on Apr 23, 2006 at 18:21 UTC |