develooper Front page | perl.beginners | Postings from December 2011

Re: uninitialized value

Thread Previous | Thread Next
From:
John W. Krahn
Date:
December 7, 2011 14:15
Subject:
Re: uninitialized value
Message ID:
4EDFE580.7030407@shaw.ca
Chris Stinemetz wrote:
>   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!

There are two changes I would make:


> 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.
>     111  while(my $line =<$FIN>) {

ADD:

              next unless $line =~ /;/;

>     112    chomp $line;
>     113    my @tokens = split(";",$line);

Change line 113 to:

               my @tokens = split /;/, $line, -1;


>     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  }




John
-- 
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

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