Dan wrote:
> i have a string $limit and i need to check it contains numbers and nothing
> else.
>
> i thought ($limit !~ /\d/) did the job, since i used to be good at this,
> i've slacked the last 6 months or so, and forgotten some of the more obvious
> things. when i find out, i'll probably slap myself and go "ahh that's it!"

Hi Dan.

  $limit !~ /\d/

will be true if $limit contains no numeric characters at all.
You want

  $limit !~ /\D/

which will be true if it contains no non-numeric characters.

Don't slap too hard :)

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to