the function changes dynamically. So I can not call a sub. The script is running from a wrapper program which passes it functions via STDIN. I cant define too much in the perl code without breaking dependencies in the wrapper script. I could get in trouble for disclosing too much but thank you very much for your input!