#!/usr/bin/perl use strict; use warnings; my $filename = 'DateiMitStringsDrin.txt'; my @array = (); if (open my $file, '<', $filename) {my @lines = <$file>; close $file; # Zeilenumbrüche entfernen chomp @lines; my %test = (); for (@lines) {# prüfen, ob NICHT in %test vorhanden (unless) unless (exists $test{ $_ }) {# ins Array schieben push @array, $_; # in %test merken $test{ $_ } = 1; } } } # test print $_."\n" for @array;