Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Short and easy way to write if...elsif syntax

by BillKSmith (Chaplain)
on Aug 27, 2012 at 12:14 UTC ( #989974=note: print w/ replies, xml ) Need Help??


in reply to Short and easy way to write if...elsif syntax

There sure is more than one way to do it!

use strict; use warnings; $_ = 'foofum'; do{ my $print_buffer = /linux/ ? 'This is a linux VM' : /Windows/ ? 'This is a Windows VM' : 'I have no idea what it is' ; print $print_buffer, "\n"; };
Bill


Comment on Re: Short and easy way to write if...elsif syntax
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-12-29 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls