Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Array of operators ...

by Your Mother (Canon)
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.


Comment on Re: Array of operators ...
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2014-09-20 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls