[EMAIL PROTECTED] wrote:
> Hi all,

Hello,

> Can some please advise how to get this to work?
> 
>    print "matches" if $string =~ m/$pattern/;
> 
> Am trying to search for a pattern but the pattern has to be a variable. Thanks
> in advance.

How did this "not work"?  What is it not doing that you want it to do?  What
warning/error messages did it generate?

You probably have regex meta-characters in $pattern that need to be escaped.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to