The blunt truth is that I'm trying to assemble a body of code to show potential employers. So maybe I should qualify my posts with the following:
- Acquiring an essential understanding of CPAN.
- Demonstrating best practices.
- Initiating best practices.
That last one requires that I fake it until I make it approach. Your recommendation strikes at the very heart of my metamorphosis.
| [reply] |
Well then a best practice might be to use List::Util::first unless you are already using List::MoreUtils for something else, and not using List::Util for anything, in which case, use List::MoreUtils::firstval.
I suggest this because it means you'll be sticking to a core module (List::Util), avoiding adding a CPAN dependency. However, if you're already using the CPAN dependency, and you're not using List::Util in the module, then there's no reason to use both modules; stick with List::MoreUtils.
I say "might", because there are always "it depends" criteria, and best practices suggestions are rarely as simple as "just do it this way."
| [reply] |