use strict; use Tie::File; my @file; tie @file, 'Tie::File', 'test.mif' or die "cannot tie file"; s/(FchangeBar )Yes/$1No/g for @file;