$myvar =~ /^X+$/;
Update: Be careful as "XXXX\n" also matches, so you might need to chomp first.
In reply to Re: Check if a variable contains only one letter?
by choroba
in thread Check if a variable contains only one letter?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |