Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: execute a string

by Eily (Monsignor)
on Apr 20, 2016 at 09:32 UTC ( #1160975=note: print w/replies, xml ) Need Help??


in reply to execute a string

That's what eval does. Be careful with it though, as it can execute any code, so you should be cautious with user input ;-)

Nb: try print $toCalc,, you'll notice that $x as already been replaced by its value. Maybe that's not what you wanted to do. Use simple quotes instead of double ones in your don't want $x to be interpolated

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1160975]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2020-06-03 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (22 votes). Check out past polls.

    Notices?