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

Re: map return to array reference

by davorg (Chancellor)
on Jan 24, 2007 at 17:06 UTC ( #596291=note: print w/ replies, xml ) Need Help??


in reply to map return to array reference

@{$self->_getGood()}

If $self->_getGood returns an array (or, indeed, a list) then there's no need to dereference it again.

I assume that '6' is the first item in the returned list.

my $files_to_send = map {"$stage/$_.pdf"} $self->_getGood();

But as you hint that you already know, you shouldn't be assigning that to a scalar, so you probably want:

my $files_to_send = [ map {"$stage/$_.pdf"} $self->_getGood() ];


Comment on Re: map return to array reference
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-11-27 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (183 votes), past polls