$1-> is an invalid argument. Try using $1-. A variable defined using set will not unset on its own. If after the code is executed the variable is not in your variables list, and you did not manually unset it (or via the script), it was never there to begin with.