do
{
print"CHOOSE ANY OF THE FOLLOWING OPTIONS:\n";
print"==========================================\n";
print"1-LOGIN & LOGOUT\n";
print"2-MAKE CALL\n";
print"3-EXIT\n";
print"==========================================\n";
print("\nENTER YOUR OPTION: ");
$option=<>;
if($option==1)
{
print("IN THE LOGIN & LOGOUT SCENARIO\n");
&Login_logout();
}
elsif($option==2)
{
print("IN THE MAKE CALL SCENARIO\n");
}
elsif($option==3)
{
print("\nEXITING...\n");
exit(0);
}
else
{
print"\nINSERT A VALID OPTION...!!!\n";
}
}while(1);
Here the subroutine Login_logout() calls a SIPp instance(command line instance). After the successful completion of the command line instance the the scalar $option takes some garbage value and hits the else condition and prints the line "INSERT A VALID OPTION...!!!". This process continues infinetly until force closing the Konsole.
Can anybody tell me where I am wrong in the script.