*subroutine is actually a typeglob. Typeglobs harken back to the days of Perl 4, before references were around. In most normal situations you shouldn't need to use them now that we have real refs.
What you've actually done is create an alias that refers to all "things" named 'refresh_list' That includes &refresh_list, $refresh_list, %refresh_list, @refresh_list, and a few more esoteric items.
#!/usr/bin/perl -w
use strict;
use vars qw($refresh_list %refresh_list @refresh_list);
%refresh_list = @refresh_list = 1..10;
$refresh_list = 'Im a scalar';
sub refresh_list { return "Im a subroutine" };
my %command_list = (
'update' => {
args => 2,
function => *refresh_list,
},
);
print "Sub: " . &{ $command_list{update}{'function'} } . "\n";
print "Scalar: " . ${ $command_list{update}{'function'} } . "\n";
print "Hash: " . %{ $command_list{update}{'function'} } . "\n";
print "Array: " . @{ $command_list{update}{'function'} } . "\n";
__END__
Sub: Im a subroutine
Scalar: Im a scalar
Hash: 4/8
Array: 10
-Blake
|