Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Should I fear eval? (want to do two things on the left side of an if/unless)

by broquaint (Abbot)
on Aug 11, 2006 at 11:20 UTC ( #566784=note: print w/ replies, xml ) Need Help??


in reply to Should I fear eval? (want to do two things on the left side of an if/unless)

If you're not using compound statements you can just put the comma operator to use e.g

my $type="blee"; print("bad type\n"), print("blee\n") unless ($type eq "newer" || $type eq "older");
HTH

_________
broquaint


Comment on Re: Should I fear eval? (want to do two things on the left side of an if/unless)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-07-30 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls