in reply to Money Regex
This seems like it'll cover more cases than you currently have (never trust your user) and it seems a bit easier as well...use strict; use Carp; my ($l, $r, @err) = split /\./, $test; carp "oops, more than 2 \.'s.\n" if @err; if ($l) { if ($r) { #handle case of rational dollars } else { #handle case of integer dollars } } else { carp "oops, we don't even have a dollar!\n"; }
HTH,
jynx
ps if another monk can spot errors please do so, it's early and i haven't had my coffee yet...
|
|---|