in reply to Re: Unobvious Pathological Code Snippets
in thread Unobvious Pathological Code Snippets

<Tim "The Toolman" Taylor>

Hrruuhhhh???

</Tim "The Toolman" Taylor>

While that's devilish and all that, how is it pathological? Heck, it doesn't even DWIM unless $n divides @_.

The interesting bit, to me, is passing arguments to the anonymous sub.

I guess I should have stated more explicitly that I'm looking for things that can't be grokked without deep diving into the docs or the source code. For instance, the continue/next behavior is documented, rather humorously, as "entertaining", without being so explicit as to spoil the fun.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^3: Unobvious Pathological Code Snippets
by BrowserUk (Patriarch) on Mar 28, 2006 at 19:44 UTC

    The thing to note is that despite having "destructively" spliced the array into chunks, the array remains unchanged after the process.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Oh, OK. I wasn't expecting this, but it's within the parameters, Jim ;)

      Is it then a copy instead of the original?

      So what are the critical characteristics? Is it the anonymous sub? The map? Or the whole gestalt? (And is "whole gestalt" pleonastic?)

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

        See Juerd's original thread: Non-destructive array processing for some explanation/discussion.

        How it works, as I understand, and anyone knows better, please correct me.

        When you pass an array to a sub, each of the elements of @_ is alias to the elements of the original array. As the destructive manipulations are applied to @_ rather than the original array, the original array and it's contents remain untouched by the process.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.