$file = "sample.dat";#変換したいファイル open(IN,$file); while(<IN>){ chomp; s/0/0/g; s/1/1/g; s/2/2/g; s/3/3/g; s/4/4/g; s/5/5/g; s/6/6/g; s/7/7/g; s/8/8/g; s/9/9/g; print "$_\n"; } close(IN);