Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
sub x { my $coderef = shift; use Data::Dumper; Data::Dumper->Dump([$coderef],['coderef']); { my $file = 'hoho.txt'; $coderef->(); } } $sub = sub { print "$file.YYY" } x $sub;
I am told "not a CODE reference at line 9" (the line where I attempt to dereference what I had hoped would be a code reference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: passing and processing code references
by tilly (Archbishop) on Oct 11, 2000 at 17:04 UTC | |
by princepawn (Parson) on Oct 11, 2000 at 17:06 UTC | |
by tilly (Archbishop) on Oct 11, 2000 at 17:53 UTC | |
|
Re: passing and processing code references
by Anonymous Monk on Oct 11, 2000 at 16:50 UTC | |
by mirod (Canon) on Oct 11, 2000 at 17:55 UTC |