Hallo svenXY,hier mein Codeausschnitt:
{
#print "Hallo 2\n";
open (CONFIGFILE,"<","$configfile") || print "Fehler beim oeffnen der Konfigurationsdatei.";
#print "Hallo 3\n";
while (my $tb = <CONFIGFILE>){
#print "Hallo 4\n";
chop $tb;
my @ta = split (/ /,$tb);
#print "Hallo: \@ta: @ta\n";
if (not($ta[0] =~ m/^#/)){#Kommentar nicht ueberpruefen
if ($ta[0] =~ m/last_stk_open_directory/){
$directory_stk = $ta[1];
}
elsif ($ta[0] =~ m/last_in_sxw_open_directory/){
$directory_in_sxw = $ta[1];
}
elsif ($ta[0] =~ m/last_out_sxw_open_directory/){
$directory_out_sxw = $ta[1];
}
}
}
close CONFIGFILE;
}
Hier der Inhalt meiner Datei:
#Konfigurationsdatei fuer Perl/Tk Oberflaeche Stuecklisten Erzeugunglast_stk_open_directory /netz/compac/daten/projekte
last_in_sxw_open_directory /netz/compac/daten/projekte
last_out_sxw_open_directory /netz/compac/daten/projekte
#last_out_sxw_open_directory /home/schmid/netz/compac/daten/projekte
#
Wenn ich die Leerzeile nach "Erzeugung" und vor "last_in_stk_open_directory" entferne oder ein Kommentarzeichen einfüge funktioniert es. Sonst bricht er bei der Leerzeile mit einlesen ab und meine Variablen werden nicht aktuallisiert.
Gruß Manfred
Datum: 24.11.2005-12:14
