--- orig.galrey.pl 2003-10-03 15:58:21.000000000 +0200 +++ galrey.pl 2003-10-03 16:13:34.000000000 +0200 @@ -196,13 +196,16 @@ #< $memos{$memo[0]} = $memo[1]; @memo = split(); @memotext=@memo; - push(@orderedfiles, $memo[0]); + push(@orderedfiles, $memo[0]) if (-f "$c_imagespath/$memo[0]"); shift(@memotext); $memos{$memo[0]} = join(" ", @memotext); # end patch } close (MEMOFILE); + foreach my $ent (@filenames) { + push(@orderedfiles, $ent) if (!exist_in_list ($ent, \@orderedfiles)); + } @filenames = @orderedfiles; } @@ -467,3 +470,14 @@ close(OUTFILE); } +sub exist_in_list +{ + my $key = shift; + my $list = shift; + my @list = @$list; + + foreach my $ent (@list) { + return 1 if ($ent eq $key); + } + return 0; +}