You don't need eval for that.
my $re = qr{^(\d+):}; my $data = '123: 45'; if ($data =~ $re) { print "Matched!"; }
In reply to Re^3: Problem when comparing strings as opposed to numerical values
by moritz
in thread Problem when comparing strings as opposed to numerical values
by dkhalfe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |