in reply to Refactoring technique?

If the elements have no individual meaning, why name them at all? Make them unnamed array members.

use Algorithm::Combinatorics ':all'; foreach (permutations([$x, $y, $z])) { doStuff($_) if $_->[0]; }

Replies are listed 'Best First'.
Re^2: Refactoring technique?
by BrowserUk (Patriarch) on Apr 24, 2015 at 14:15 UTC

    That makes a lot of sense, but in context, may be rather harder to achieve than in your snippet.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked