while (my $line = <$IN> ) { $line =~ s/Weiß/Schwarz/g if /\sb\s/ .. (not /\sb\s/);