Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Is undef list assignment a no-op?

by repellent (Priest)
on Mar 26, 2011 at 04:23 UTC ( #895633=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://895633]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-09-28 18:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found