This is because you are storing the name of the subroutine in your hash, when you should be storing a reference to the subroutine.
my %scripts = (
"010" => {
sub => \&ACC_GET_STEP,
step => '010',
},
"020" => {
sub => \&ACC_PUT_STEP,
step => '020',
},
"030" => {
sub => \&ACC_GET_STEP,
step => '030',
},
);
You can then call the sub like this:
$sub = $scripts{$script}{sub} ;
$sub->($file, $step);
# Or
&$sub($file, $step);
The first way of doing it looks cleaner and and running
subs with a & prefix is a bad habit as it has magic
when no arguments are passed.