Hallo Malzeit,
Ich hab da ein problem was ich nicht versteh:
Der error log sagt:
Use of uninitialized value in concatenation (.) or string at logintest.pl line 81, <DATEN> line 1.
Use of uninitialized value in concatenation (.) or string at logintest.pl line 81, <DATEN> line 2.
Use of uninitialized value in concatenation (.) or string at logintest.pl line 81, <DATEN> line 3.
Use of uninitialized value in concatenation (.) or string at logintest.pl line 81, <DATEN> line 4.
aber das ist doch immer die selbe linie ,warum 1,2,3,4
Das problem zeigt auf
if (/^$username:$crypted/)
in der sub die so
sub check {
open(DATEN, "<$htpasswd")||die("401 error 5\n");
flock(DATEN, LOCK_SH)||die("401 error 4\n");
while (<DATEN>){
if (/^$username:$crypted/)
{
close (DATEN);
return 1;
}
}
return 0;
}
aussieht.
Abfragen tu ich elsif (check()) {mach was} else {bad()....
keine ahnung was jetzt wieder falsch ist.
Ich habs mal mit if (/^$username:$crypted/) versucht,dann gibts zwar kein fehler im error log,aber dann funktioniert das script auch nicht mehr ?Kann man das auch anders als mit while lösen?
Grüsse
Alain