in reply to Re: Is undef list assignment a no-op?
in thread Is undef list assignment a no-op?

Just as AnonyMonk mentioned. @job, I used the undef assignment as an optimization to avoid an intermediate copy of a large string, but still wanted to assign second arg onwards. foo is a function that wrote the string to a file, and is a code hotspot.

Replies are listed 'Best First'.
Re^3: Is undef list assignment a no-op?
by BrowserUk (Patriarch) on Mar 26, 2011 at 06:45 UTC

    Yes. I tend to avoid callback interfaces where possible; and pass large parameters, including huge scalars by reference rather than by value.

    But, I realise that we don't always have control over the modules we have to use, or the design choices of their authors.


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.