my suggestion would be to pass a reference to a hash to the subroutine; using this approach, u could pass any number of variables by just assigning a key => value to the hash, and since you're passing the hash by reference to the subroutine, you'll be able to access all the hash data inside the subroutine by simply dereferencing the hash. for example,