
thangdd
New User
Oct 31, 2009, 2:23 AM
Post #1 of 2
(1370 views)
|
|
How to convert string to an expression in PERL
|
Can't Post
|
|
Hi every body! I have a quesion for my problem with using mysql and perl programming. - data from mysql is logic expression. After query I get it's value on string format: my $data = "$sex < 1 && $age >= 17 && $age <= 40 && ',1,2,3,' =~m/(,)$optid(,)/"; In this expression $sex,$age,$optid is variables - How to make Perl understanding this function? my $sex,$age,$optid; if ($data) { ........ ........ } as if ($sex < 1 && $age >= 17 && $age <= 40 && ',1,2,3,' =~m/(,)$optid(,)/) { ........ ........ } Please!!!!
|