Hi all,

I have an array of regular exps of which I want to match any of them in a string. How can I do this without eval.

for eg.

@array = (
                '/^to: myprog/mi',
                 '/^from: [EMAIL PROTECTED]/mi'
         );

$STRING = read_mail_header(...);


foreach (@array) { if($STRING=~ $_ ) { # This does not work # FOUND ............. } }


# NOTFOUND ......




I know I can do eval foreach (@array){ ( '($FOUND=1) if ($STRING=~' . $_ . ')') } # Is there a better solution



Thanks
Ram
                


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to