spetrowitsch
asked on
error message: local variable in a subroutine is not initialised
I have defined a subroutine with a local variable. The local variable is a list. The compilation it isn't correct,its follow the error message:
"Use of unitialized value".
Here are the code
sub dat {
my @result_tmp;
open(T,"<$$QLRESULT");
$anz=0;
while($zeile=~m/ORA_VERSIO N/){
chomp($zeile);
$result_tmp[$anz]=$zeile;
$anz=$anz+1;}
close(T);
if ($result_tmp[0] eq "")#error-message
{ do something;}
}
"Use of unitialized value".
Here are the code
sub dat {
my @result_tmp;
open(T,"<$$QLRESULT");
$anz=0;
while($zeile=~m/ORA_VERSIO
chomp($zeile);
$result_tmp[$anz]=$zeile;
$anz=$anz+1;}
close(T);
if ($result_tmp[0] eq "")#error-message
{ do something;}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Where does $zeile come from?