#! C:\Perl\bin\perl.exe use warnings; use strict; my @choices = (); my $fileChoices = "../data/choices.txt"; print "Content-type: text/html\n\n"; print "

Hello

\n"; print "\n"; print "TEST1\n"; print "\n"; my @mychoices = &getmychoices($fileChoices); print qq~\n~; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Select Stadt
Select Daten
\n"; print "\n"; print "\n"; # ------------------------------------------------------------ sub getchoices { my @back = (); pop(@back); my $on = 0; for (@mychoices) { if ( $_ =~ /<\#$_[0]>/ ) { $on = 0; } if ( $on == 1 ) { push( @back, $_ ); } if ( $_ =~ /<$_[0]>/ ) { $on = 1; } } print "$on\n"; return @back; } # getchoices # ------------------------------------------------------------ sub getmychoices { my ($fileChoices) = @_; unless ( open( ALT, $fileChoices ) ) { print " Konnte datei '$fileChoices' nicht oeffnen: $!\n"; exit 0; } my @choices = ; chomp(@choices); close(ALT); my $self_name = substr( $0, rindex( $0, "\\" ) + 1 ); my $self_path = substr( $0, 0, rindex( $0, "\\" ) + 1 ); my @mychoices = (); my $on = 0; for (@choices) { if ( $_ =~ /end choices.+$self_name/ ) { $on = 0; } if ( $on == 1 ) { push( @mychoices, $_ ); } if ( $_ =~ /start choices for $self_name/ ) { $on = 1; } } # for return (@mychoices); } # getmychoices # ------------------------------------------------------------