view tools/incpri.pl @ 560:d6ff45d719a5 string-shared

string sharing
author kono
date Sat, 07 Jan 2006 18:11:53 +0900
parents a379da780856
children e055df7c1082
line wrap: on
line source

#!/usr/bin/perl

for(@ARGV) {
    my $filename = $_;
    rename($filename,$filename.".bak");
    open(IN,"<$filename.bak");
    open(OUT,">$filename");
    $d = "0000";
    while(<IN>) {
       s/printf\(\"\#\d+\:/printf\(\"\#$d\:/;
       s/printf\(\"([^#])/printf\(\"\#$d\:$1/;
       $d++;
       print OUT;
    }
}