my $regex1 = '(hello)'; my $test = 'hello there'; if ($test =~ /$regex1/) { print "$1\n"; }
It shoudl work just fine. Also, you're looking for qr//. Look for it under quoting operators.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
In reply to Re: Storing Regex Patterns in Scalars
by dragonchild
in thread Storing Regex Patterns in Scalars
by iana
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |