Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: More efficient dereferencing of a subroutine return

by parv (Priest)
on Feb 18, 2013 at 00:49 UTC ( #1019252=note: print w/ replies, xml ) Need Help??


in reply to Re^5: More efficient dereferencing of a subroutine return
in thread More efficient dereferencing of a subroutine return

It seems you and I read the representation of the problem differently. Your reply presumes that every return from sub is always a return of an array reference. (If that promise is made to the user of the sub, then I have no disagreement with direct dereferencing of the return value.) I think of the value returned being an array reference where possible; else, nothing or undef is returned.


Comment on Re^6: More efficient dereferencing of a subroutine return
Replies are listed 'Best First'.
Re^7: More efficient dereferencing of a subroutine return
by Anonymous Monk on Feb 18, 2013 at 01:03 UTC
    Look, no temporaries, no fatal :) my @stuff = eval { @{ func() } };

      Can you please stop being Anon and create an account?

      It helps those of us ( read - me ) who want to follow your, often informative, responses.

        You can't add features and then tell people not to use them :)
      You have my vote.-)
      You have my vote.-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2015-08-28 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (339 votes), past polls