Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^5: More efficient dereferencing of a subroutine return

by AnomalousMonk (Archbishop)
on Feb 19, 2013 at 23:26 UTC ( [id://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"])

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1019677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-25 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found