<?xml version="1.0" encoding="windows-1252"?>
<node id="287987" title="Re: Perl Idioms Explained - my $string = do { local $/; &lt;FILEHANDLE&gt; };" created="2003-08-31 02:22:24" updated="2005-07-07 15:23:50">
<type id="11">
note</type>
<author id="249299">
skillet-thief</author>
<data>
<field name="doctext">
Maybe I'm missing something. Besides basic coolness, and getting it down to one line, I don't understand the specific advantage of using "do" as opposed to how I usually slurp:
&lt;code&gt;
my $string;
{
local $/ = undef;
$string = &lt;FH&gt;;
}
&lt;/code&gt;
That said, I &lt;i&gt;do&lt;/i&gt; like the way the proposed idiom looks.&lt;br /&gt;&lt;br /&gt;

Cheers,&lt;br /&gt;

s-t</field>
<field name="root_node">
287647</field>
<field name="parent_node">
287647</field>
</data>
</node>
