try this one:
# perl -Mstrict -le 'my $x=shift; print 1 if $x=~/^[0-9]$|^10$/' 10
1
On 4/2/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
> How do I write the expression, if the variable match between 0 to 10? Below
> is the wrong expression I wrote which is suppose to be if $eightdecks match 0
> to 10. So i want the answer to be yes.
> Thanks
>
> my $eightdecks = 6;
>
> if($eightdecks =~ /[0-10]/){
> print "Yes match\n";
> }else{print "no"};
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/