[quote=Noisebreath,20.09.2006, 14:27]doch ich benutze strict[/quote]
wenn du strict benutzen würdest, hättest du eine andere fehlermeldung
bekommen, $fh wäre nämlich an der stelle gar nicht deklariert gewesen.
es hilft nicht, einfach zu sagen, dass man strict benutzt, wenn man es nicht tut.
hier ein beispiel:
$ perl -wle'
if (1) {
my $fh = "foo";
}
else {
my $fh = "bar";
}
print $fh'
Name "main::fh" used only once: possible typo at -e line 8.
Use of uninitialized value in print at -e line 8.
mit strict:
$ perl -Mstrict -wle'
if (1) {
my $fh = "foo";
}
else {
my $fh = "bar";
}
print $fh'
Global symbol "$fh" requires explicit package name at -e line 8.
Execution of -e aborted due to compilation errors.