On Sat, Oct 03, 2009 at 11:02:56PM -0700, andrew@pimlott.net (via RT) wrote:
> The following program generates a perplexing warning:
>
> % perl -w
> my %h = map {
> my(@x) = (undef, undef);
> } 1;
> Use of uninitialized value in list assignment at - line 2.
>
> What's wrong with the list assigment at line 2? Nothing! It's really
> complaining about the hash assigment at line 1. Tell me what's really
> upsetting you, perl, don't blame something else!
Ah, no!
There are only two types of assignment: scalar and list, and the warning
is correct. You can see the same warning in the simplified code:
$ perl -we 'my %h =(undef,undef)'
Use of uninitialized value in list assignment at -e line 1.
--
Fire extinguisher (n) a device for holding open fire doors.
Thread Previous
|
Thread Next