#!/usr/bin/perl -w use strict; my $output; $output = $ARGV[0].".clean"; open (INF, "< $ARGV[0]"); open (OUF, "> $output"); while () { s/{BS}/\b/g; } print OUF $riga; close (INF); close (OUF); #### {BS}{BS} | ------- this is current position {BS}{BS} ---- this is what it finds! {BS}{BS} ----- and this is what it deletes, leaving me with a {BS{BS