in reply to Re^2: What CODE typeglob slot is my anonymous sub in?
in thread What CODE typeglob slot is my anonymous sub in?
#!/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; no strict 'refs'; $type_sub = \&$function; *$function = sub { warn Devel::Peek::CvGV($type_sub); }; } *TINYTEXT = \&TEXT; TINYTEXT(); __END__ *main::TEXT at ovid.pl line 18.
Is that what you want?
If you assign an anonymous sub to a scalar and stuff that into the code slot, it remains __ANON__.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What CODE typeglob slot is my anonymous sub in?
by Ovid (Cardinal) on Apr 24, 2007 at 10:39 UTC | |
by shmem (Chancellor) on Apr 24, 2007 at 12:41 UTC |