I studied Perl and I came across a code snippet below:
print $$q, "\n"
There is a variable $qthat we do not know for sure. However, we know that when we run this code, it prints "world".
$q
"world"
So what could be $q? What does it mean $$q?
$$q
In your case $q, a scalar link. Therefore, $$qit gives the scalar specified by the link $q. A simple example:
$a = \"world"; #Put reference to scalar with string "world" into $a print $$a."\n"; #Print scalar pointed by $a
$$q == ${$q}
$q represents the link and you are trying to dereference it in a scalar context.
For more information, visit the perlref documentation .