my @a_csv_tmp = grep !/$h_csv_ref/ , @a_h_csv_ref; while( @a_h_csv_ref ) { shift( @a_h_csv_ref ); } push( @a_h_csv_ref, @a_csv_tmp ); while( @a_csv_tmp ) { shift( @a_csv_tmp ); } open( ERR, ">>$bindir/mailtext.txt" ); print ERR ">>>> h_csv_ref ############\n"; print ERR $h_csv_ref . "\n"; print ERR "<<< #######################\n\n"; print ERR ">>>> a_csv_tmp ############\n"; foreach my $eintrag_1 ( @a_csv_tmp ) { print ERR $eintrag_1 . "\n"; } print ERR "<<< #######################\n\n"; print ERR ">>>> a_h_csv_ref ##########\n"; foreach my $eintrag_2 ( @a_h_csv_ref ) { print ERR $eintrag_2 . "\n"; } print ERR "<<< #######################\n\n"; close( ERR );