in reply to Detect presence of numbers 1-9
You could use a regex to either match the characters that you want or alternatively to not match the characters that you don't want:
#!/usr/bin/perl -wl use strict; my $scalar = '1335'; print "Found" if $scalar =~ /^[1-5]+$/; print "Found" if $scalar !~ /[^1-5]/;
--
John.
In Section
Seekers of Perl Wisdom