Also, if you go this way, I recommend that you don't return 0 on errors. Just

```perl
return;
```
will return false in list and scalar contexts.