in reply to Bug in latest File::Util?
update: scratch all the below... I didn't read the message clearly enough, and didn't test before posting (bad on me). This is coming from within the module itself, so yeah, it's a module problem, and its definitely a bug ;) You've got some extremely concise and simple reproduction steps for your bug ticket.
...
I wouldn't consider this to be a bug myself... since the module is explicitly collecting *files*, if there are no files, I would kind of expect the method to return undef if nothing was found, or an empty list.
Although I didn't examine the docs extremely closely, it doesn't look like it states what the return type is if no files are found. It may be better to have an empty list returned in this case, so the user doesn't have to perform a check to ensure defined before using the list, even if empty.
You could request clarification from the author (after you carefully review the entire documentation and perhaps the source; it could be very explicit) whether if undef is their intentional behaviour or not, and perhaps to update the docs to reflect the intentional return type in this case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bug in latest File::Util?
by anonymized user 468275 (Curate) on Jun 21, 2016 at 12:29 UTC |