<?xml version="1.0" encoding="windows-1252"?>
<node id="989951" title="Re: Short and easy way to write if...elsif syntax" created="2012-08-27 05:30:20" updated="2012-08-27 05:30:20">
<type id="11">
note</type>
<author id="616540">
moritz</author>
<data>
<field name="doctext">
&lt;p&gt;If you have a non-ancient version of Perl 5, this should work:

&lt;code&gt;
use 5.010;
foreach (@array)
{
    when (/linux/)   { say "This is linux VM"          }
    when (/Windows/) { say "This is Windows VM"        }
    default          { say "I have no idea what it is" }
}
&lt;/code&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-616540"&gt;
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
989949</field>
<field name="parent_node">
989949</field>
</data>
</node>
