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.
In reply to Re^2: What CODE typeglob slot is my anonymous sub in?
by Ovid
in thread What CODE typeglob slot is my anonymous sub in?
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |