You just need to chomp the user input before testing it. When the user enters 'l' or 'g', he also hits "enter", which appends a '\n' character at the end (newline). $alignment_type will never be equal to 'g' or 'l' until you've removed that newline character with chomp.
Just remember that anytime you read from a filehandle you need to account for trailing newline characters1. chomp does that for you.
1. Unless the record separator has been changed or you're performed some other similar trickery. (update)
Dave
In reply to Re: Basic 'while' loop problem
by davido
in thread Basic 'while' loop problem
by BioBoy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |