open $vf, '>>', $b #### while (<$vf>) { if($_ =~ /module entity\;/) #### open $vf, '+<', $b or die $!;