in reply to Basic regular expressions

1. This code is just looking for any number of backslashes
if ($var ~= m/\*/)
No, the backslash works as an escape character. You're matching for a literal "*".

2. This code is matching for a backslash but what does the $ mean
unless($path ~= m/\/$/)
No. The backslashs works as an escape character again. '$' means 'match at end of string' (you seem to know the meaning of $ in your next question, though). So this matches against a forward slash at the end of $path.

3. This code is replacing . gz at the end of a string. with nothing
$output ~= s/\.gz$//;
Correct.

You're welcome.