<?xml version="1.0" encoding="windows-1252"?>
<node id="195947" title="Re: while(&lt;&gt;) { ... } considered harmful" created="2002-09-07 20:55:23" updated="2005-08-04 03:46:22">
<type id="11">
note</type>
<author id="132236">
Juerd</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;blockquote&gt;&lt;em&gt;
map { require Net::DNS } 1;
&lt;/em&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;
Is that a map in void context? Nasty and evil. (I don't recall [require] ever returning anything useful.)
&lt;/p&gt;

&lt;p&gt;&lt;blockquote&gt;&lt;em&gt;Personally I prefer always using while(my $line = &lt;&gt;) construct. 
&lt;/em&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;
I don't always. Setting $_ lets one use regexes and simple commands easier. I do use a lexical for more complicated blocks, but I often find myself just slurping the file into an array first.
&lt;/p&gt;



&lt;p&gt;&lt;font color=green&gt;&lt;pre&gt;
- Yes, I &lt;a href="http://plp.juerd.nl/" target="_blank"&gt;&lt;font color="green"&gt;reinvent&lt;/font&gt;&lt;/a&gt; wheels.
- Spam: Visit &lt;a href="http://eurotraq.com/" target="_blank"&gt;&lt;font color="green"&gt;eurotraQ&lt;/font&gt;&lt;/a&gt;.
&lt;/pre&gt;&lt;/font&gt;&lt;/p&gt;</field>
<field name="root_node">
195926</field>
<field name="parent_node">
195926</field>
</data>
</node>
