Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance... code here populates normal array (@perf_array) # put the elements into a hash array for (my $k = 0; $k <= $#perf_array; $k++) { while( my ($oid, $perf) = each %values ) { if ($perf_array[$k] =~ /.*\d+\s+$perf.*/) { $perf_hash{$perf} = $perf_array[$k]; $perf_hash{$perf} =~ s/\*\s+(\d+)\s+$perf/$1/eg; $perf_hash{$perf} =~ s/\s*$//g; chomp $perf_hash{$perf}; } } } for (my $l = 0; $l <= $#perf_array; $l++) { $perf_array[$l] =~ s/\*\s+\d+\s+(.*)/$1/eg; $perf_array[$l] =~ s/\s*$//g; chomp $perf_array[$l]; while( my ($oid1, $perf1) = each %values ) { if ( $perf1 != /$perf_array[$l]/ ) { $perf_hash{$perf1} = "0"; print "$perf1 not found; set to $perf_hash{$perf1}\n"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: normal array exists question
by Limbic~Region (Chancellor) on Jul 21, 2004 at 18:09 UTC | |
by JanneVee (Friar) on Jul 21, 2004 at 18:27 UTC | |
by Limbic~Region (Chancellor) on Jul 21, 2004 at 19:34 UTC | |
by Anonymous Monk on Jul 22, 2004 at 07:08 UTC | |
Re: normal array exists question
by ysth (Canon) on Jul 21, 2004 at 18:53 UTC | |
Re: normal array exists question
by JanneVee (Friar) on Jul 21, 2004 at 18:17 UTC |