# update sheet sub update_sheet { my ($kw,$value,$comment) = @_; my ($sht,$r,$c) = @{$kwhashref->{$kw}}[0..2]; my $sel = $Book->Worksheets($sht)->Cells($r,$c+1); $sel->Insert({ Shift => -4161}); # xlToRight $sel->{Value} = $value; $sel->AddComment( { Text=> $comment } ); $kwhashref->{$kw}[3] = $value; # for debugging } #### if (/($re).*addr = ([.\d]+)/){ print "LIne $line_no kw=[$1] value=[$2] special\n"; update_sheet($1,$2,$_); next; } # match more than 1 per line e.g. usim and isim while (/($re)[ =]*([.\d]+)/g){ print "Line $line_no kw=[$1] value=[$2]\n"; update_sheet($1,$2,$_); }