simple wildcard regex problem.



The short version is: How do I get $regex = qr{^...$}; to work.

I get this error message, and I don't understand what it's telling me:
"Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ]/ at
../temp.pl line 87, <DATA> line 2."

------------------------------
Here's the long version: How do I get $regex = qr{^$regexstring$}; to
work.

while ($_ < "$numberofletters") {
$foo = substr($unsolvedword, $_, 1);
if ($foo eq "-"){
$regexstring .= ".";
} else {
$regexstring .= "$foo";
};
$_++;
}

.