<?xml version="1.0" encoding="windows-1252"?>
<node id="287819" title="Re: Re: Re: Perl Idioms Explained - my $string = do { local $/; &lt;FILEHANDLE&gt; };" created="2003-08-29 15:53:40" updated="2005-08-12 19:45:00">
<type id="11">
note</type>
<author id="137285">
Wally Hartshorn</author>
<data>
<field name="doctext">
&lt;blockquote&gt;But why get a module and a function just for this two expression idiom?&lt;/blockquote&gt;

&lt;p&gt;I guess the main reason would be that it would be fairly self-evident, even to a Perl newbie, what File::Slurp does and how to use it. I think the first time someone comes across the code in the OP (and perhaps the second and third times as well), they will find it a bit mystifying. Remembering how to use it in their own code could also be a bit difficult.&lt;/p&gt;

&lt;p&gt;That's not to say that there's an overwhelming reason to use File::Slurp, just that it could certainly be justified for reasons of code clarity.&lt;/p&gt;

&lt;p&gt;Disclaimer: I've never used File::Slurp. I'm assuming that it doesn't suck. :-)&lt;/p&gt;

&lt;p&gt;Wally Hartshorn&lt;br&gt;&lt;br&gt;
(Plug: Visit [http://javajunkies.org/|JavaJunkies], PerlMonks for Java)&lt;/p&gt;</field>
<field name="root_node">
287647</field>
<field name="parent_node">
287758</field>
</data>
</node>
