
netmonky
Novice
Feb 18, 2011, 3:37 AM
Views: 1933
|
|
uninitialized value - help please.
|
|
|
Hi all, I have some data that looks like name,address,phone,,friend,1,2,3,4 name,address,phone,8,friend,1,2,3,4 I am splitting the values and assigning them to variables in a while loop. while (<INFILE>) { my @filelist = split(/,/,$_); my $name = $filelist[0]; my $add = $filelist[1]; my $phone = $filelist[2]; my $num = $filelist[3]; <<--Use of uninitialized value $filelist[3] my $friend = $filelist[8]; I keep seeing Use of uninitialized value $filelist[3] when nothing is in field 3 of the array. I can turn warning off and all is good :-) -- but I would like to know the correct way of doing this please. Thanks in advance! Mark
(This post was edited by netmonky on Feb 18, 2011, 3:41 AM)
|