in reply to Re^2: Loosing Negative Values in Array Ref
in thread Loosing Negative Values in Array Ref
By that point in the code, there are no negatives anywayNo.
Here, I think this is what you want:
for my $aref_acc_num (sort { $a->[0] cmp $b->[0] } values %$acc_num) { push @$all_dta_acc_num, my $tmp = []; for my $aref (@$aref_acc_num) { for my $i (0..1) { $tmp->[$i] = $aref->[$i]; } for my $i (2..$#$aref) { if (!defined($tmp->[$i])) { $tmp->[$i] = $aref->[$i]; } elsif ($tmp->[$i]=~m/^[+-]?\d+$/) { #numeric $tmp->[$i] = $aref->[$i] if $aref->[$i] > $tmp->[$i]; } else { $tmp->[$i] = $aref->[$i] if $aref->[$i] gt $tmp->[$i]; } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Loosing Negative Values in Array Ref
by Anonymous Monk on Jun 03, 2009 at 14:43 UTC | |
by Thelonius (Priest) on Jun 03, 2009 at 16:01 UTC |
In Section
Seekers of Perl Wisdom