You are defining get_Origserver with a prototype, telling perl that this function receives no arguments (see perlsub). Leave the parens() off of the function definition. BTW, you can get the same effect of the goto in a more perlish way by defining a block and using redo: