more useful options | |
PerlMonks |
Re: map return to array referenceby kyle (Abbot) |
on Jan 24, 2007 at 17:09 UTC ( [id://596292]=note: print w/replies, xml ) | Need Help?? |
Your map is returning a list (Update Hmmm, maybe not so much). If you want a reference to an array containing that list, wrap it in square brackets:
The reason you get Can't use string ("6") as an ARRAY ref is that the array returned by map, in a scalar context, is turned into the cardinality of the array, so $files_to_send gets the value 6. I even went so far as to declare $files_to_send = []; like so, and I still get the same results. This is the part that I don't understand. Setting $files_to_send to a reference to an empty array should give you no output in the code you have above. It really gives the same error, or it fails a different way?
In Section
Seekers of Perl Wisdom
|
|