> -----Original Message-----
> From: Chris Stinemetz [mailto:[email protected]]
> Sent: Wednesday, December 07, 2011 4:11 PM
> To: [email protected]
> Subject: uninitialized value
>
> after converting an older Perl script to using strict pragma I am
> getting the follow error:
>
> I can't seem to figure out how to resolve this. I'm in hopes that there
> is someone that can let me know what I am missing?
>
> Thank you in advance!
>
> Chris
>
> Use of uninitialized value in numeric eq (==) at ./evdo.pl line 126,
> <$FIN> line 1.
> Use of uninitialized value in numeric lt (<) at ./evdo.pl line 126,
> <$FIN> line 1.
Obviously, $cell and $icell are not defined at line 126.
Check the number of elements in @tokens for each line.
If the number of elements is less than you expect -
print an error message along with the offending line.
Perhaps there is a blank line
or a line formatted differently than you expect.
HTH,
Ken
> 111 while(my $line = <$FIN>) {
> 112 chomp $line;
> 113 my @tokens = split(";",$line);
> 114
> 115 next if($tokens[0] > 100);
> 116
> 117 my $srt = $tokens[$fieldMap{"SRT"}];
> 118 my $srfc = $tokens[$fieldMap{"SRFC"}];
> 119 my $cfc = $tokens[$fieldMap{"CFC"}];
> 120 my $cfcq = $tokens[$fieldMap{"CFCQ"}];
> 121 my $cell = $tokens[$fieldMap{"Cell"}];
> 122 my $icell = $tokens[$fieldMap{"ICell"}];
> 123 my $isector = $tokens[$fieldMap{"ISector"}];
> 124 my $sector = $tokens[$fieldMap{"Sector"}];
> 125
> 126 if( 0 == $cell && 0 < $icell) {
> 127 $cell=$icell;
> 128 $sector = $isector;
> 129 }
> 130
> 131 my $mkt = getMarket($cell);
> 132 my $c_s = sprintf("%d_%d",$cell,$sector);
> 133
> 134 if(!defined $evdo{$c_s}) {
> 135 initHash(\%evdo);
> 136 }
> 137
> 138 processPegs($c_s,\%evdo);
> 139 if($mkt =~ /\w+/) {
> 140 processPegs($mkt,\%evdoSummary);
> 141 }
> 142 }
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/