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

Re: [perl #69560] misleading warning: Use of uninitialized valuein list assignment

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
January 1, 2010 16:15
Subject:
Re: [perl #69560] misleading warning: Use of uninitialized valuein list assignment
Message ID:
20100102001534.GA32153@iabyn.com
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; e.g.:

$ cat -n /tmp/p
     1	#!/usr/bin/perl -w
     2	
     3	my $x =
     4	      1
     5	    + 2
     6	    + 3
     7	    + 4
     8	    + undef;
     9	
$ perl /tmp/p
Use of uninitialized value in addition (+) at /tmp/p line 3.
$

-- 
O Unicef Clearasil!
Gibberish and Drivel!
    -- "Bored of the Rings"

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