Ramprasad wrote:
>
> 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) {
>
.
}
}
or look into perldoc perlre
Regards,
Michel
-Message d'origine-
De: Ramprasad [mailto:[EMAIL PROTECTED]
Date: mercredi 13 août 2003 08:51
À: [EMAIL PROTECTED]
Objet: array of regular expressions on a string
Hi all,
I have an array of regular exps of whi
Rob Dixon wrote:
Ramprasad wrote:
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=~
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) {
Ramprasad wrote:
>
> This was not cut pasted from my actual code. I cannot paste my 250
> line script here so I just wrote a hapazard relevant replica of what
> I did.
Fair enough! An even worse problem is where people's company standards
prohibit decent coding, but I always bear in mind that what