Hi,
Maybe I don't understand it, too.
Isn't what you want achieved by deleting the double quotes ?
So it reads:
$formula = $data_a[$i] + $data_b[$i];

Cheers,
Rob
Visit our website at http://www.kalinabears.com.au
----- Original Message -----
From: $Bill Luebkert <[EMAIL PROTECTED]>
To: Rivera, Claudia <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 07, 2000 12:01 PM
Subject: Re: string to float and int


> "Rivera, Claudia" wrote:
> >
> > I think you misundertood my question, or maybe I am asking for something
> > that
> > is not possible.
> >
> > My formula is not always going to be the same.
> > So, I just wanted to map the input to some of my variables, so that I
did
> > not
> > have to parse the whole formula.
> >
> > I want to be able to convert the string: "$data_a[$i] + $data_b[$i]"
> > into an actual numeric operation.
> >
> > The variable $formula contains my expression, but right now it is taken
as a
> > string. Is there any way I can convert it as part of my perl code???
>
> use eval eg: eval "\$my_num=$formula";
>
> See perlfunc man page.
> --
>   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
>  (_/   /  )    // //       DBE Collectibles   http://www.wgn.net/~dbe/
>   / ) /--<  o // //      Mailto:[EMAIL PROTECTED]   http://dbecoll.webjump.com/
> -/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to