note
biohisham
When you assign to a reference a value (in this case an anonymous sub), dereference that reference to access its value:
<c>
hisham@bioslayer:~$ perl -
my $subref = sub{print 'a',"\n";};
(my $test)?print 'c' : $subref->(); #dereference with infix arrow operator
__END__
a
hisham@bioslayer:~$ perl -
my $subref = sub{print 'a',"\n"};
(my $test)?print 'c' : &{$subref}; #dereference with &{}
__END__
a
</c>
check %perldoc [http://perldoc.perl.org/perlsub.html|perlsub]
<p></p><p></p><p></p>
<code>
</code>
<div class="pmsig"><div class="pmsig-769448">
<hr>
David R. Gergen said "We know that second terms have historically been marred by hubris and by scandal." and I am a two y.o. monk today :D, June,12th, 2011...
</div></div>
919930
919930