If you're wanting to limit the user's input, that would be dependant on the 
interface of choice (HTML? TK? Curses? )


-r

On Monday 18 February 2002 06:49 pm, you wrote:
> On Feb 19, Daniel Falkenberg said:
> >Just wondering if Perl is able to could how many digits there is in a
> >variable.  Basically I want a user to be only able to enter 10 digits no
> >more no less.  Is there a way perl can count this variable and with a
> >little if/else statment I can display the result.
>
> Well, Randal's answer is to make sure a variable consists ONLY of 10
> digits -- if that's what you needed, ok.
>
> If you want code that sees how many digits there are in a string, you can
> use tr///:
>
>   $digit_count = $str =~ tr/0-9//;

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

Reply via email to