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

Re: a warning I'd like to see

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
January 24, 2008 17:09
Subject:
Re: a warning I'd like to see
Message ID:
20080125010945.GS31127@klangraum
* David Nicol <davidnicol@gmail.com> [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
thread…

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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