my $orig = "## ---------------------- ## muu ## ----------------------" my $replace = "## Fisch ## Fleisch" while( <> ){ s/$orig/$replace/; print; }