T
TonyV
Hopefully this is a really simple question.
I am using a map function to get an array, and I need to pass a
reference to that array to another function. Right now, this is
working:
# @queues is an array of anonymous hashes
my @q = map { $_->{name} } @queues;
do_something(\@q);
My question is this: Is there any way to skip assigning that
temporary variable and pass the result of the map function directly in
the do_something function call? Something like this:
# This is syntactically incorrect, but I need to pass the result of
the
# map function to do_something as an array *reference*, not an array.
do_something(\map { $_->{name} } @queues);
Thanks for any help!
I am using a map function to get an array, and I need to pass a
reference to that array to another function. Right now, this is
working:
# @queues is an array of anonymous hashes
my @q = map { $_->{name} } @queues;
do_something(\@q);
My question is this: Is there any way to skip assigning that
temporary variable and pass the result of the map function directly in
the do_something function call? Something like this:
# This is syntactically incorrect, but I need to pass the result of
the
# map function to do_something as an array *reference*, not an array.
do_something(\map { $_->{name} } @queues);
Thanks for any help!