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

Re^5: More efficient dereferencing of a subroutine return

by AnomalousMonk (Abbot)
on Feb 19, 2013 at 23:26 UTC ( #1019677=note: print w/ replies, xml ) Need Help??


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

This also works and is 'shorter', although I would not say more maintainable:

>perl -wMstrict -MData::Dump -le "sub fillArrays { my( $r1, $r2 ) = @_; @$r1 = qw(one two three); @$r2 = qw(four five six seven); } ;; fillArrays( \my (@arr1, @arr2) ); ;; dd \@arr1, \@arr2; " (["one", "two", "three"], ["four", "five", "six", "seven"])


Comment on Re^5: More efficient dereferencing of a subroutine return
Download Code
Re^6: More efficient dereferencing of a subroutine return
by gg48gg (Sexton) on Feb 20, 2013 at 19:49 UTC
    Thanks to all of you. I am going to stick to the "keep it simple, stupid" philosophy even though it is more lines and typing. I appreciate everyones' replies.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-12-29 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (192 votes), past polls