in reply to Re: List::MoreUtils::first_value() question
in thread List::MoreUtils::first_value() question

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:

  1. Acquiring an essential understanding of CPAN.
  2. Demonstrating best practices.
  3. 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.

  • Comment on Re^2: List::MoreUtils::first_value() question

Replies are listed 'Best First'.
Re^3: List::MoreUtils::first_value() question
by davido (Cardinal) on Jul 30, 2013 at 19:05 UTC

    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."


    Dave