in reply to Re: Check user input - reimplementation
in thread Check user input - reimplementation
I'd do this in reverse order, so that you aren't substituting in a space that you're later going to remove. That's just a tiny amount of extra work.You mean like this?
Okay so$checks{'data'} =~ s/\s+$//; $checks{'data'} =~ s/^\s+//; $checks{'data'} =~ s/\s+/ /g;
is the same as$checks{'regex'} ||= $default;
But what does the following do?$checks{'regex'} = $checks{'regex'} ? $checks{'regex'} : $default;
exists($checks{'regex'}) or $checks{'regex'} = $default;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Check user input - reimplementation
by Roy Johnson (Monsignor) on Dec 16, 2003 at 21:26 UTC |