1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
\n\n
<!--EDIT|Strat|1146675567-->