<?xml version="1.0" encoding="windows-1252"?>
<node id="1013279" title="Re: filehandle for close" created="2013-01-14 16:05:12" updated="2013-01-14 16:05:12">
<type id="11">
note</type>
<author id="176576">
eyepopslikeamosquito</author>
<data>
<field name="doctext">
&lt;P&gt;
You need to lose the braces around the argument to [doc://close] because Perl is interpreting that as an anonymous hash (as "use warnings" will tell you).
This works for me:
&lt;CODE&gt;
use strict;
use warnings;
my %files;
open $files{"foo"}, '&gt;', "xyz"   or die "open failed: $!";
print { $files{"foo"} } "done\n" or die "print failed: $!";
# close { $files{"foo"} };    # oops: 'Odd number of elements in anonymous hash'
close $files{"foo"};          # works ok
&lt;/CODE&gt;
&lt;/P&gt;
</field>
<field name="root_node">
1013273</field>
<field name="parent_node">
1013273</field>
</data>
</node>
