in reply to Re^7: Module Bloat and the Best Solution
in thread Module Bloat and the Best Solution

What if the arrays are (1, 2, 2, 3) and (1, 3, 5) and I want my map to run over (1, 2, 3, 1, 3, 5) ? Doesn't matter why ... what if that is the requirement?

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^8: Module Bloat and the Best Solution

Replies are listed 'Best First'.
Re^9: Module Bloat and the Best Solution
by codeacrobat (Chaplain) on Nov 13, 2007 at 21:37 UTC
    Well then an alternative is to use brackets.
    map { something } uniq(@arr1), uniq (@arr2).
    The saving of 4 brackets
    map { something } uniq @arr1, uniq @arr2.
    comes at the cost of looking in the code and finding out (and remembering) the signature. If the whole developing team uses List::MoreUtils and prototypes are well understood by everyone then its ok to save the brackets. Otherwise, and that is my personal opinion, preserve the default semantic of list flattening and be explicit by using brackets.

    print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});