$var uses the value of the variable whose name is the value of $var.
It means $$var is known as reference variable where as $var is normal variable.
It allows you to have a “variable’s variable” – the program can create the variable name the same way it can create any other string.