sub CheckArgs { get number of args get args to check check we have the right number of args foreach arg check the type with the appropriate reg exp. return status. } sub Func1 { CheckArgs (2, @_, "NUM", "STRING"); .... other code } sub Func2 { CheckArgs (3, @_, "STRING", "NUM", "STRING"); .... other code }