This snippet does the following:
- Copies the contents of $fname to $bname
- Binds the regular expression to $bname
- Removes everything up to the final backslash ( \ ) from the string stored in $bname. Specifically, this expression (using the alternate delimiter '#') greedily matches any number of any characters (.*) followed by a backslash (which must be escaped, thus \\).
So the string 'C:\folder\file' would be transformed to 'file'.
All the details needed to parse the regular expression can be found in perlre and/or prelretut.