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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Kazian

    Turning String into Numerical Equation

    Brian Kazian, Mar 13, 2005, in forum: Python
    Replies:
    20
    Views:
    701
    Steven Bethard
    Mar 17, 2005
  2. Replies:
    8
    Views:
    337
    Bo Yang
    Oct 14, 2006
  3. Robert
    Replies:
    10
    Views:
    1,588
    Robin
    Apr 21, 2004
  4. Jayesh Kamdar
    Replies:
    2
    Views:
    154
    Gunnar Hjalmarsson
    May 25, 2005
  5. syang8

    Perl for calculating an expression.

    syang8, Jul 23, 2008, in forum: Perl Misc
    Replies:
    3
    Views:
    107
    J├╝rgen Exner
    Jul 23, 2008
Loading...

Share This Page