sub GetGalleryFileAndCaptions { #.... #open DATA, "<$CaptionFile" or return qq|Program Error! Could not open file: $CaptionFile. Debugging information: $!|; #chomp (my @LINES = ); #close DATA; ################################################################ # Den ganzen Datensatz auf einmal einlesen my $data=''; open my $rfh, '<', $CaptionFile or return qq|Program Error! Could not open file: $CaptionFile. Debugging information: $!|; { # perldoc perlvar local $/ = undef; $data = <$rfh>; } close $rfh or return qq|Program Error! Could not close file: $CaptionFile. Debugging information: $!|; # Das "\r" entfernen $data=~tr/\x0D//d; # Daten splitten my @CAPTIONS=split(/\x0A\x0A/,$data); ################################################################ for my $p (0 .. $#PICS) { $PicDisplayReturn .= "PIC:
\"$CAPTIONS[$c]\"
CAPTION:
$CAPTIONS[$c]
"; } #$PicDisplayReturn =~ s/\015\012|\012|\015//sg; return $PicDisplayReturn; }