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

Re: a warning I'd like to see

Thread Previous | Thread Next
Aristotle Pagaltzis
January 24, 2008 17:09
Re: a warning I'd like to see
Message ID:
* David Nicol <> [2008-01-25 00:50]:
> alert me when I give map an arrayref instead of an array

Sorry, no. I’ve passed complex data structures to `map` more
times than I care to remember. This wouldn’t be a warning, it
would be a nag screen.

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

This would be caught by the stricture that MJD proposed a few
weeks ago, where stringifying or numifying references is
forbidden. That would trap a bunch of hard-to-find mistakes I’ve
made while almost never getting in my way. Let me start a new

Aristotle Pagaltzis // <>

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