I was writing a simple perl script which calculates payment based on the hours given by the user and the program mustn't allow payments above 500 hrs but has to allow upto 600 for females, and I was using the unless function but it is not working it allows more than 600 hrs for females.
here is the code I used
print("Enter your working hours");
$hours=<stdin>;
print("Enter your gender");
$gender=<stdin>;
chomp($gender);
unless($gender ne "f" && $hours>=600){
print("Your have earned ",$hours*10," Birr \n");
}
else{
unless($hours>=500){
print("Your have earned ",$hours*10," Birr \n");
}
else{
print("You have worked beyond the payable hrs!");
}
}