The $= silences the return code from going to the console. Yes it is better to pass a var as an argument than to make it global.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.