theSeeker03
Programmer
I am reading pipe-delimited data, line by line, from file INUSERS and storing it in a 2-dimensional array. However, when I print out the results, only the data for the last line of the file is being printed. AND it is being printed as many times as there are lines present in the input file!
How can I change it to print evey line? The i and j are iterating as expected and as i step through when debugging, the correct lines are fed in.
=================
my $numOfEntries =0;
while (<INUSERS>){
chomp($_);
@line = split(/\|/,$_);
$arrayOfEntries[$numOfEntries]= \@line;
$numOfEntries++;
}
for ($i=0;$i<$numOfEntries;$i++){
for ($j=0;$j<$#{$arrayOfEntries[$i]}+1;$j++){
print OUTUSERS $i." ".$j." ".$arrayOfEntries[$i]->[$j]."\n";
}
}
How can I change it to print evey line? The i and j are iterating as expected and as i step through when debugging, the correct lines are fed in.
=================
my $numOfEntries =0;
while (<INUSERS>){
chomp($_);
@line = split(/\|/,$_);
$arrayOfEntries[$numOfEntries]= \@line;
$numOfEntries++;
}
for ($i=0;$i<$numOfEntries;$i++){
for ($j=0;$j<$#{$arrayOfEntries[$i]}+1;$j++){
print OUTUSERS $i." ".$j." ".$arrayOfEntries[$i]->[$j]."\n";
}
}