Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Assist in understanding of old code

by ozgurp (Beadle)
on Feb 28, 2005 at 23:18 UTC ( #435231=note: print w/replies, xml ) Need Help??

in reply to Re: Assist in understanding of old code
in thread Assist in understanding old code

Sorry it should not have been commented out, so the code is:
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++; }
I don't really know what is going on in this code, I am working on it.

Replies are listed 'Best First'.
Re^3: Assist in understanding of old code
by Mugatu (Monk) on Feb 28, 2005 at 23:49 UTC

    Well then, if the line shouldn't actually be commented out, then the problem is as talexb described, "one of the values in the array that's being sorted is undefined." You have two ways of solving that problem:

    • Use an empty string value instead of undef
    • Turn off the warning

    Which solution you pick will usually depend highly on the application. I tend to structure my apps in a way that an empty string makes more sense than undef, but perhaps this one isn't. In that case, turning off the warning (using a lexically scoped no warnings) would be the best option.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://435231]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-05-24 02:05 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (82 votes). Check out past polls.