#!perl -w use Data::Dumper; $action = 'setup'; $filelocation = '.'; %formdata = ( 'one' => 123, 'two' => 234, ); my %functions = ( "setup" => { function => \&get_events, args => [\%formdata, $filelocation] }, ); $functions{ $action }->{function}-> ( $functions{ $action }->{args} ); sub get_events { my $ref = shift; my $hashref = $ref->[0]; # get \%formdata my $fileloc = $ref->[1]; # get $filelocation print "F:$fileloc\n"; print Dumper( $hashref ); print $hashref->{one},$/,$hashref->{two},$/; }