insert the manual counter for all heads
===

I want to insert my own label for all coming sections in a tex file. For this I am using perl. Here is the code, but how can I manually insert my own counter to all of the sections?

#user/perl/bin use warnings; use strict; use Win32;  my ($filename,$line);   # storing the file content open(INPUT, "<D:/JOBRELATED/FAR/1.tex") or die Win32::MsgBox("Pl. check the Input File...", 64, "sections");  while(<INPUT>){ $line.=$_ }  # remove all the lables  while($line =~ m/\\label\{(.*?)\}/g){  my $labeltext=$1;  $line =~ s/\\label\{(.*?)\}/\%\\&del;label\{$1\}/g; }  $line=~ s/&del;//g;  my $chno=1; my $secno=1; my $subsecno=1;  # inserting the counter for sections  if ($line =~ m/\\section\{(.*?)\}\n%\\label\{(.*?)\}/msgi) {     my $labeltext=$2;     print "$labeltext\n";     $line =~ s/$labeltext/&del;ch$chno\_sec$secno/;  $secno++;  }   $line=~ s/&del;//g;  close(INPUT);  open (OUTPUT, ">D:/JOBRELATED/FAR/1.tex") or die "could not write.."; print OUTPUT "$line"; close (OUTPUT); 

Thx,
Prasad