You want don't want to use eq and a pattern. Use something like this instead...
for (1..10) { ... last if ($charread =~ /\s/); }
or
for (1..10) { ... last if ($charread eq " " || $charread eq "\t" ....); }
Update: Reread the supplied code :)
Update 2: replace $_ with $charread.
In reply to Re: Regex and loop question
by MidLifeXis
in thread Regex and loop question
by perl_seeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |