<?xml version="1.0" encoding="windows-1252"?>
<node id="181258" title="Re: Re: Random Tips on Parse::RecDescent" created="2002-07-12 09:21:39" updated="2005-07-07 14:58:24">
<type id="11">
note</type>
<author id="57126">
hsmyers</author>
<data>
<field name="doctext">
Ok, I'll bite...
&lt;code&gt;
#!/perl/bin/perl
#
#  coderefs.pl -- Yes you can use strict...
use strict;
use warnings;
use diagnostics;

for (qw(foo bar)) {
        ($main::{$_} or sub { print "No such sub: $_\n" })-&gt;();
}
$_ = 'baz';
$main::{$_}(); # works! but,
&amp;{$_}(); # doesn't...

sub foo {
        print "Yes, I'm here.\n";
}

sub baz {
        print "I'm here as well.\n";
}
__END__
&lt;/code&gt;
So my question is why?
&lt;p&gt;&amp;ndash;hsm&lt;/p&gt;
&lt;em&gt;"Never try to teach a pig to sing&amp;hellip;it wastes your time and it annoys the pig."&lt;/em&gt;</field>
<field name="root_node">
180778</field>
<field name="parent_node">
181168</field>
</data>
</node>
