in reply to Re: What CODE typeglob slot is my anonymous sub in?
in thread What CODE typeglob slot is my anonymous sub in?
Nice idea, but that doesn't work. The following minimal test case prints '*main::__ANON__'.
#!/usr/bin/perl use strict; use warnings; use Devel::Peek; my @types = qw( text ); foreach my $type (@types) { my $function = uc $type; my $type_sub; $type_sub = sub { warn Devel::Peek::CvGV($type_sub); }; no strict 'refs'; *$function = $type_sub; } *TINYTEXT = \&TEXT; TINYTEXT();
Did I misunderstand?
Cheers,
Ovid
New address of my CGI Course.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What CODE typeglob slot is my anonymous sub in?
by shmem (Chancellor) on Apr 24, 2007 at 10:30 UTC | |
by Ovid (Cardinal) on Apr 24, 2007 at 10:39 UTC | |
by shmem (Chancellor) on Apr 24, 2007 at 12:41 UTC |