in reply to Finding the name of the target of a coderef
#!/usr/bin/perl use strict; use warnings; my $anon = sub { return "foo " . "bar" }; my $retVal = &$anon; print $retVal ;
#!/usr/bin/perl use strict; use warnings; my $anon = bar->new; my $retVal = &{$anon->{a}}; print $retVal ; package bar; sub new{ my $self = bless{}; $self->{a} = sub { return "bar"; } ; $self; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding the name of the target of a coderef
by moot (Chaplain) on Apr 14, 2005 at 22:41 UTC | |
|
Re^2: Finding the name of the target of a coderef
by Forsaken (Friar) on Apr 14, 2005 at 22:42 UTC |