#!/usr/bin/perl -w use strict; my $file=shift; open(FILE,$file) or die("Damn I cant open this thing\n\n$!"); #open(NEWF,">fixed_$file") or die("Damn I cant open this thing\n\n$!"); while() { #print $_."\n"; if($_ =~ /^1\|\d{3}(\+)$/) { s/$1/XXXXXXX/; print $_."\n"; } }