#!/usr/bin/perl use strict; use 5.010; use warnings; my $EMPTYname = "EMPTY"; my ( @dataEempty, @output ); open BOUNDARY, "< /home/wolf/Dokumente/emty.txt"; @dataEempty = ; close BOUNDARY; foreach ( @dataEempty ) { my $lineEmpty = shift @dataEempty; unless ( $lineEmpty =~ /$EMPTYname/ ) { &schreibe ( $lineEmpty, \@output ) } else { &schreibe ( $lineEmpty, \@output ); last } } my $weiter = 0; foreach my $lineEmpty(@dataEempty) { if ( $lineEmpty =~ /\}/ ) { &schreibe ( $lineEmpty, \@output ); $weiter = 1 # Umschalter } else { &schreibe ( $lineEmpty, \@output ) if $weiter == 1 } } open OUT, "> /home/wolf/Dokumente/boundary"; foreach my $line (@output) { print OUT $line } close OUT; sub schreibe { my ($lineEmpty, $ar) = shift; print "Es wird geschrieben: = $lineEmpty \n"; push @$ar, $lineEmpty }