develooper Front page | perl.perl5.porters | Postings from January 2008

a warning I'd like to see

Thread Next
David Nicol
January 24, 2008 15:45
a warning I'd like to see
Message ID:
alert me when I give map an arrayref instead of an array

$ perl -le 'use warnings; print join "|", map {$_ + 2} [ 1..6 ]'

this happened to me today, as a function was returning an arrayref and
I forgot to wrap it in @{...} before feeding it to map.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About