#!/usr/bin/perl -w my $TestFile = "testfile"; my $found1 = 0; my $found2 = 0; my %found_arr = (); my $i = 0; if( ! open( TFH, $TestFile)) { print STDERR "Test File '$TestFile' kann nicht gelesen werden !\n"; exit 1; } while( $line = ) { chomp $line; if( ( $line =~ m/^\s*([\x28])/i ) && ( ! $found1 ) ) { $found_arr[$i]=$line; $i++; $found1 ++; } if( ( $found1 ) && ( ! $found2 ) ) { if( ! $found2 ) { if( ( $line !~ m/^\s*([\x28])/i ) && ( $line !~ /\Q)/ ) ) { $found_arr[$i]=$line; $i++; } else { if( $line =~ /\Q)/ ) { $found2 ++; $found_arr[$i]=$line; $i++; } } } } } close( TFH); for( $i = 0; $i <= $#found_arr; $i++) { print "$found_arr[$i]\n"; } exit 0;