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

Re: a warning I'd like to see

Thread Previous | Thread Next
From:
Juerd Waalboer
Date:
January 24, 2008 17:36
Subject:
Re: a warning I'd like to see
Message ID:
20080125013852.GD1789@c4.convolution.nl
David Nicol skribis 2008-01-24 17:45 (-0600):
> alert me when I give map an arrayref instead of an array
                                                     ^^^^^

map takes a LIST, not an ARRAY. A reference by itself is a fine
single-element list.

There is no way to not-give a list to map, since every Perl EXPRession
in list context results in a valid list. A list can have zero or any
positive number of elements.
-- 
Met vriendelijke groet,  Kind regards,  Korajn salutojn,

  Juerd Waalboer:  Perl hacker  <#####@juerd.nl>  <http://juerd.nl/sig>
  Convolution:     ICT solutions and consultancy <sales@convolution.nl>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About