in reply to Check if a variable contains only one letter?
You should say "it contains X from the beginning to the end":
$myvar =~ /^X+$/;
Update: Be careful as "XXXX\n" also matches, so you might need to chomp first.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom