Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: map return to array reference

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

in reply to map return to array reference

Just enclose your map in square brackets to create an array reference.

my $files_to_send = [map {"$stage/$_.pdf"} @{$self->_getGood()}];
Look at the following example:
my @ary = qw/a b c d/; my $var = @ary; # $var is 4; @ary is interpreted in scalar context my $var1 = [@ary]; #$var is ['a','b','c','d']

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (20)
As of 2015-08-03 13:43 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (37 votes), past polls