Fix Perl errors.

The filename was done against the variable `$file` instead of
`$fname`, which lead to Perl failing under `strict` mode.

Fixed now.