CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Executing Expression in Perl Script

 



Raj_hpking
Novice

Jul 22, 2014, 2:42 AM

Post #1 of 3 (1164 views)
     Executing Expression in Perl Script  

Hi Perl Expert,

Would like to know how can we execute expression in the Perl Script. Below is scenario,

Suppose I have stored express " (A + (B+C)/100) + D)" in the database. I want to fetch this expression and by dynamically replacing A, B, C & D with their values want to execute it.

Summary: My executable expression is stored in database, I want to fetch it replace constant and execute the same in Perl.

How can I achieve the same.


FishMonger
Veteran / Moderator

Jul 22, 2014, 6:11 AM

Post #2 of 3 (1162 views)
     Re: [Raj_hpking] Executing Expression in Perl Script [In reply to]  

See: perldoc -f eval
http://perldoc.perl.org/functions/eval.html


Laurent_R
Veteran / Moderator

Jul 22, 2014, 9:51 AM

Post #3 of 3 (1158 views)
     Re: [Raj_hpking] Executing Expression in Perl Script [In reply to]  

Please post your questions in only one of the forum sections. You've received a detailed answer in the beginners' section.

I'll lock this one to prevent duplicate work.


(This post was edited by Laurent_R on Jul 22, 2014, 9:52 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives