#!/usr/bin/perl use strict; use warnings; my $file_1 = '/pfad/zur/datei.txt'; my $file_2 = '/pfad/zur/datei.dat'; { local $/ = "\n\n"; open(my $fh_1,'<',$file_1) or die $!; open(my $fh_2,'<',$file_2) or die $!; while(defined(my $entry = <$fh_1>) and defined(my $entry_2 = <$fh_2>)){ tu_was($entry,$entry_2); } close $fh_1; close $fh_2; }