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

Discussion in 'Perl Misc' started by rajesh, Nov 23, 2005.

  1. rajesh

    rajesh Guest

    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
     
    rajesh, Nov 23, 2005
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.