ozgurp has asked for the wisdom of the Perl Monks concerning the following question:
Hi All!
I have been given a task of modifying someone else's program. The program i have to modify does not use strict and warnings. So I decided to put them in, and I am having all sorts of error messages. Anyway I fixed most of these errors, but there is a a bit that I just cannot fix and also I don't understand the syntax. Could you help me figure out what the program is trying to do? Here is the code (@ldx array is a multidimensional array and I cannot put it here because it is quite big):
This is the syntax I don't understand (I now it is doing some kind of sorting but this is where the program is giving error messages):my $ct=0; my @nxxult = (); my @Ultmnsort = (); my @indexUlt = (); for(my $rn=4;$rn<=32;$rn +=4) { for(my $bn=1;$bn<=$row[0];$bn++) { $nxxult[$bn]=$ldx[$bn][$rn]; } #@indexUlt=sort{$nxxult[$a]<=>$nxxult[$b]} 0 ... $#nxxult; $Ultmnsort[$ct]=$indexUlt[0]; $Ultmxsort[$ct]=$indexUlt[$#indexUlt]; $ct++; [$#indexUlt]\n"); print TEST3 ("ct = $ct\n"); }
Here is the error message:#@indexUlt=sort{$nxxult[$a]<=>$nxxult[$b]} 0 ... $#nxxult;
Use of uninitialized value in numeric comparison (<=>) at C:\SORT.pl l +ine 791, <AREA> line 22371.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Assist in understanding old code
by tirwhan (Abbot) on Feb 28, 2005 at 23:52 UTC | |
Re: Assist in understanding old code
by osunderdog (Deacon) on Feb 28, 2005 at 23:13 UTC | |
Re: Assist in understanding of old code
by talexb (Chancellor) on Feb 28, 2005 at 22:58 UTC | |
by ozgurp (Beadle) on Feb 28, 2005 at 23:18 UTC | |
by Mugatu (Monk) on Feb 28, 2005 at 23:49 UTC |
Back to
Seekers of Perl Wisdom