<?xml version="1.0" encoding="windows-1252"?>
<node id="919725" title="Re: for loop ?" created="2011-08-10 15:43:43" updated="2011-08-10 15:43:43">
<type id="11">
note</type>
<author id="664508">
philipbailey</author>
<data>
<field name="doctext">
&lt;p&gt;Of course, [doc://for] is indeed a looping construct, but in this case the for loops each have only one iteration.  The programmer is using the "for" to set the default variable $_ to the value of $os or $hardware in each case, then performing a regular expression match (/.../), implicitly on $_, against various values.  Older Perls (5.8 and prior) do not have a switch statement (well, given/when statement), so various other approaches have been used in the past to emulate one.  I would probably not use this particular approach myself, but it seems to work well enough.&lt;/p&gt;</field>
<field name="root_node">
919722</field>
<field name="parent_node">
919722</field>
</data>
</node>
