Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Dereference the return result from a function

by stevieb (Canon)
on Feb 21, 2017 at 03:46 UTC ( #1182396=note: print w/replies, xml ) Need Help??


in reply to Take reference of the return result from a function

As tybalt89 stated, your request doesn't quite match your examples, and he's shown how to return a reference. Here's a way to dereference an array reference returned from a sub, using the circumfix operator:

my @derefed = @{ blah() }; sub blah { return [1, 2, 3]; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2020-05-31 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (174 votes). Check out past polls.

    Notices?