JNameNotTaken
Programmer
Hi All
Sorry to have to ask this. but it's been driving me daft for the last few hours.
I need to verify that a scaler contains only digits and only 12 of them at that.
I've tried these (among others) to no avail:
if( $variable =~ m/\d\d\d\d\d\d\d\d\d\d\d\d/ )
if( $variable = /\d\d\d\d\d\d\d\d\d\d\d\d/ )
but those just won't work correctly, the number of digits entered can be any number and it will return true.
Any help will help keep me sane, thanks very much.
Sorry to have to ask this. but it's been driving me daft for the last few hours.
I need to verify that a scaler contains only digits and only 12 of them at that.
I've tried these (among others) to no avail:
if( $variable =~ m/\d\d\d\d\d\d\d\d\d\d\d\d/ )
if( $variable = /\d\d\d\d\d\d\d\d\d\d\d\d/ )
but those just won't work correctly, the number of digits entered can be any number and it will return true.
Any help will help keep me sane, thanks very much.