On Fri, Jan 1, 2010 at 7:59 PM, Eric Brine <ikegami@adaelis.com> wrote:
> On Fri, Jan 1, 2010 at 7:15 PM, Dave Mitchell <davem@iabyn.com> wrote:
>
>> On Fri, Jan 01, 2010 at 05:42:57PM -0500, Eric Brine wrote:
>> > I agree that "list assignment" is correct, but why does the warning say
>> line
>> > 2?
>>
>> Because perl currently only records line numbers per statement, not per
>> op
>
>
> I realize that, but it doesn't explain the difference between
>
> >perl -lw
>
> my %h = map {
> my $x;
> (undef, undef)
> }
> ^Z
> syntax error at - line 4, at EOF
> Execution of - aborted due to compilation errors.
>
> >perl -lw
> my %h = (
>
> (undef, undef)
> );
> ^Z
> Use of uninitialized value in list assignment at - line 1.
>
> The assignment didn't move, so why did the warning?
>
>
Can you tell I'm tired? I recreated the test I ran the test earlier a
"little" too fast. Here's what I should have said:
I realize that, but it doesn't explain the difference between
>perl -lw
my %h = map {
my $x;
(undef, undef)
} 1;
^Z
Use of uninitialized value in list assignment at - line 2.
and
>perl -lw
my %h = (
(undef, undef)
);
^Z
Use of uninitialized value in list assignment at - line 1.
The assignment didn't move, so why did the warning?
Thread Previous
|
Thread Next