perlquestion
raj8
array
increment
index
unpack
Hello Perl Monks,
I am have been attempting to unpack columns and increment the
output, however, the increment operator starts at 1. Here
is an example output:
<CODE>
drive 0
dirve 1
drive 2
drive 3
I am using this:
open(LIST,"list -l|");
while(<LIST>) {
($drive) = unpack '@0 A3',$_;
if(/Drive/) {
$count++;
}
system("list -delete -dr -index ${count}");
};
However, when it gets to 3 it says can't delete 4 because
the $i++ started at 1 instead of 0.
</CODE>
Any suggestions would help. thanks--
raj8
<p><i>Originally posted as a Categorized Question. </i></p>