my $string = q~*Elset, elset=KORN_10 232, 259, 260, 261, 286, 287, 288, 289, 290, 313, 314, 315 342, 343, 344, 345, 346, 347, 348, 371, 372, 373, 374, 375 ..... und so weiter... 14556, 14557, 14558, 14581, 14582, 14583, 14584, 14585, 14609, 14610 *End Part~; my $text = "Test\n"; $string =~ s/\*End Part/${text}*End Part/; print $string;