sub some_func { my $func = 'backup'; my $client = 'mars'; my $cmd = eval_cmd($func); # here magic happens! seurity_check($cmd); system("$cmd"); }