我引用的子例程很少,我需要将值传递给引用的子例程。有没有办法做到这一点。
#Sample Code
sub CreateHtmlBox {
my ($box_type,$hash_ref) = @_;
my %subCall = (
'singlebox' => \&CreateSingleBox ,
'multiplebox' => \&CreateMultipleBox
);
my $htmlCode = $subCall->($box_html);
}
sub CreateSingleBox {
my ($box_type) =@_;
#...................
return $htmlCode;
}
我想调用引用的子程序并将哈希的引用传递给它。
CreateSingleBox($hash_ref)