Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by repellent (Priest)
on Mar 26, 2011 at 04:23 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-16 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found