daveola has asked for the wisdom of the Perl Monks concerning the following question:
Is there a syntax to simply turn the value of something returned from a function into a reference?
For example, I want to return an array reference for an array built by map. Right now I am doing:
I'd prefer something like:my @tmp = map { ... } @somearray; return \@tmp;
I know I could do it by writing another routine or using a library, but I was wondering if there was anything in plain old perl that can accomplish this?return ref_of map { ... } @somearray;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Dereference the return result from a function
by tybalt89 (Monsignor) on Feb 21, 2017 at 03:22 UTC | |
by daveola (Sexton) on Feb 21, 2017 at 08:35 UTC | |
Re: Dereference the return result from a function
by stevieb (Canon) on Feb 21, 2017 at 03:46 UTC | |
Re: Dereference the return result from a function
by tybalt89 (Monsignor) on Feb 21, 2017 at 03:29 UTC | |
by daveola (Sexton) on Feb 21, 2017 at 08:36 UTC | |
by hippo (Bishop) on Feb 21, 2017 at 09:01 UTC |
Back to
Seekers of Perl Wisdom