I have few referenced subroutine and I need to pass the value to the referenced subroutine. Is there any way to do it.
#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;
}
I want to call referenced subroutine and pass the reference of hash to it.
CreateSingleBox($hash_ref)
$subCall->($box_html)should be (assuming you want to callCreateSingleBox):$subcCall{singlebox}->( $box_html ).