my $file = "...."; my (@links, @texts); unless (-f $file) { # &create_linklist ohne klammern bedeutet &create_linklist(@_) !!! &create_linklist(); } else { open (my $FH, "<", $file ) or die "Error: couldn't read '$file': $!\n"; my @data = grep { not /^\s*\#/ } <$FH>; close( $FH ); chomp( @data ); my @links = (); foreach my $line (@data) { if ( $line =~ s/^LINK:\s*/ ) { push (@links, $line) } elsif( $line =~ s/^TEXT:\s*/ ) { push (@texts, $line) } else { print "invalid: $line\n" } } # foreach } # else