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

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top