hbm has asked for the wisdom of the Perl Monks concerning the following question:
Given a simple subroutine:
sub q { print "q" };What is it that causes the following to output nothing?
eval \&q;While these others output as expected?
eval \q; eval \q(); eval \&q();
I've read about the ampersand and prototyping, but I'm not understanding this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval'ing coderef with ampersand
by jwkrahn (Abbot) on Sep 04, 2010 at 03:36 UTC | |
by hbm (Hermit) on Sep 07, 2010 at 13:13 UTC | |
by ikegami (Patriarch) on Sep 07, 2010 at 17:45 UTC | |
|
Re: eval'ing coderef with ampersand
by AnomalousMonk (Archbishop) on Sep 04, 2010 at 07:51 UTC | |
by hbm (Hermit) on Sep 07, 2010 at 13:24 UTC |