$ret_val = my_sub($arg1, "", $arg2, "", "", $arg3); And in the subroutine: sub my_sub{ $arg1 = shift; $undef1 = shift; $arg2 = shift; $undef2 = shift; $undef3 = shift; $arg3 = shift; ....... and so on }