my $start_Note = 'N<'; my $N = ''; my $end_Note = '\.>'; my $n = ''; open(DATA, "; s/$start_Note/$N/g for @file; s/$end_Note/$n/g for @file;