smeshy123
02-29-2008, 06:12 PM
About a quarter of the way of going through my two text files, the script stops executing the nested loop and just finishes going through the outside loop. I have no idea why this is happening. I'm new to perl so be gentle!
PS: Pretend *** is the name of the real variable. Apparently my variable name is being cencored. It is a truncation of assignment.
foreach $*** (@***_data) {
chop ($***);
($***_a,$***_hn,$***_n,$***_rdc)=split(' ',$***);
#set up boundaries
$x_min = $***_hn - $x_sen;
$x_max = $***_hn + $x_sen;
$y_min = $***_n - $y_sen;
$y_max = $***_n + $y_sen;
$j = 0;
print "$x_min, $x_max \n";
foreach $cs (@cs_data) {
chop ($cs);
($hn_1, $hn_2, $hn_3, $hn_4, $hn_5, $hn_6, $hn_7, $hn_8, $hn_9) = split(' ',$cs);
if ($hn_5 = "H" && $hn_6 = "H" && $hn_7 < $x_max && $hn_7 > $x_min) {
$k = 0;
print "$***_a, $hn_7 \n";
}
}
}
PS: Pretend *** is the name of the real variable. Apparently my variable name is being cencored. It is a truncation of assignment.
foreach $*** (@***_data) {
chop ($***);
($***_a,$***_hn,$***_n,$***_rdc)=split(' ',$***);
#set up boundaries
$x_min = $***_hn - $x_sen;
$x_max = $***_hn + $x_sen;
$y_min = $***_n - $y_sen;
$y_max = $***_n + $y_sen;
$j = 0;
print "$x_min, $x_max \n";
foreach $cs (@cs_data) {
chop ($cs);
($hn_1, $hn_2, $hn_3, $hn_4, $hn_5, $hn_6, $hn_7, $hn_8, $hn_9) = split(' ',$cs);
if ($hn_5 = "H" && $hn_6 = "H" && $hn_7 < $x_max && $hn_7 > $x_min) {
$k = 0;
print "$***_a, $hn_7 \n";
}
}
}