Something like this:

```perl
if ($file !~ m{^(/.*)$}) {
    $self->error("Weird file name $file");
    return undef;
}
$file = $1,
```