open ($in,'<test.txt') || die ("Datei existiert nicht"); while (<$in>){ if (/fred/ .. /\-\-\-/) { push (@ergebnis,$_); } pop @ergebnis; print@ergebnis; |
open ($in,'<test.txt') || die ("Datei existiert nicht"); while (<$in>){ if (/fred/ .. /\-\-\-/) { push (@ergebnis,$_); $found=1; } else {last if $found==1;} } pop @ergebnis; print@ergebnis; |