<?xml version="1.0" encoding="windows-1252"?>
<node id="580748" title="Re^3: What magic is this?" created="2006-10-26 08:46:38" updated="2006-10-26 04:46:38">
<type id="11">
note</type>
<author id="510280">
shmem</author>
<data>
<field name="doctext">
That code block in my Expat.pm (version 2.34) looks like
&lt;c&gt;
  if (defined $arg) {
    if (ref($arg) and UNIVERSAL::isa($arg, 'IO::Handle')) {
      $ioref = $arg;
    } elsif (tied($arg)) {
      my $class = ref($arg);
      no strict 'refs';
      $ioref = $arg if defined &amp;{"${class}::TIEHANDLE"};
    }
    else {
      require IO::Handle;
      eval {
        no strict 'refs';
        $ioref = *{$arg}{IO} if defined *{$arg};
      };
      undef $@;
    }
  }
&lt;/c&gt;
&lt;p&gt;but to me it looks equally scary. &lt;c&gt;undef $@&lt;/c&gt; after &lt;c&gt;eval&lt;/c&gt;? wtf?
&lt;p&gt;At least, there's &lt;c&gt;no strict 'refs';&lt;/c&gt; inside the eval (but isn't it
another wtf?)
&lt;p&gt;--shmem
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-510280"&gt;
&lt;small&gt;&lt;pre&gt;
_($_=" "x(1&lt;&lt;5)."?\n".q&amp;middot;/)Oo.  G&amp;deg;\        /
                              /\_&amp;macr;/(q    /
----------------------------  \__(m.====&amp;middot;.(_("always off the crowd"))."&amp;middot;
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e &amp;&amp; print}&lt;/pre&gt;&lt;/small&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
580738</field>
<field name="parent_node">
580747</field>
</data>
</node>
