$a = sub {return @_[0]}; (yes I know....) $b = sub {return @_[0]+1}; .... some code ..... if (something) $i = $a; else $i = $b; &lala ($i); sub lala{ my $i = $_[0]; $res = &{$i}($number) ; #have also tried $res = $i->($number) with the same result }