Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Array of operators ...

by Your Mother (Chancellor)
on Sep 12, 2013 at 19:52 UTC ( #1053790=note: print w/replies, xml ) Need Help??


in reply to Array of operators ...

Try something along these lines-

... my $statement = "4 $op 5"; print join(" = ", $statement, eval $statement), $/; ... __END__ 4 + 5 = 9 4 - 5 = -1 4 * 5 = 20 4 / 5 = 0.8

eval can be dangerous since it executes any code so be careful with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053790]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2016-12-07 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.