Indeed,

```perl
unlink($to_unlink) or $self->error("Unable to delete $to_unlink: $!");
```

would be better.