Hi, if i'm understanding you correctly, I think what you want to do should
be coded like this:

$value = 2422; �
$reg = '\d';
    if ($value =~ m/$reg/) {
       print "Correct Value;
    }   else   {
       print "Check the Value";
    }

-----Original Message-----
From: Prabahar Mosas [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 8:43 AM
To: [EMAIL PROTECTED]
Subject: Assigning regexpression to a variable


Hai,

     I have problem to assign a regular expression
into a variable.  If any one know regarding this
mail me as early as possible. If it is cannot give
me alternative solution.

specimen coding
**************
$value = 2422; �
$reg = '/\d/';
    if ($value =~ $reg) {
       print "Correct Value;
    }   else   {
       print "Check the Value";
    }

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to