Thread Zwei Arrays "synchron" ausgeben (9 answers)
Opened by cbxk1xg at 2008-11-23 15:18

Gast Gast
 2008-11-23 17:13
#116554 #116554
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
sub GetGalleryFileAndCaptions
{
#....

#open DATA, "<$CaptionFile" or return qq|Program Error! Could not open file: $CaptionFile. Debugging information: $!|;
#chomp (my @LINES = <DATA>);
#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:<br><img src=\"$URLpicdir$PICS[$p]\" alt=\"$CAPTIONS[$c]\" border=\"0\" class=\"GalleryPic\"><br>CAPTION:<br>$CAPTIONS[$c]<hr>";
        
        }

#$PicDisplayReturn =~ s/\015\012|\012|\015//sg;
return $PicDisplayReturn;
}

View full thread Zwei Arrays "synchron" ausgeben