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

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:
    859
    Steven Bethard
    Mar 17, 2005
  2. Replies:
    8
    Views:
    520
    Bo Yang
    Oct 14, 2006
  3. Aman JIANG
    Replies:
    18
    Views:
    817
    Kai-Uwe Bux
    Sep 23, 2007
  4. voorth
    Replies:
    4
    Views:
    551
    voorth
    Feb 12, 2008
  5. Giles

    ORDER BY - "numerical string" problem

    Giles, Jan 5, 2006, in forum: ASP General
    Replies:
    7
    Views:
    236
  6. Robert
    Replies:
    10
    Views:
    2,128
    Robin
    Apr 21, 2004
  7. Jayesh Kamdar
    Replies:
    2
    Views:
    276
    Gunnar Hjalmarsson
    May 25, 2005
  8. syang8

    Perl for calculating an expression.

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