# ab perl5.6, bei aelteren ist noch ein defined hilfreich while( my $line = <> ) { chomp $line; print if $line =~ /xyz/; }