How to convert string to an expression in PERL or calculating numerical string

R

rajesh

HI,
In PERL, I have a string $a=' ( ((1) && (0) && (0)) || (1) ) '. I
got this string by replacing some text into 1' s and 0's. Now I want to
calculate this numerical expression and I need result for that. In
normal case, the value of $a would be the same string, but in this
condition, i want its value to be equal to '1'(by evaluating the
expression). how to get that value by evaluating the string as a
numerical expression? plz Plz....

thanks in advance
Rajesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top