Hi there,

I am trying to figure out how to use grep in a particular situation.
The line is:

        next unless grep ($fromdevice, @sitenamekeys);


but I am not quite matching properly.

@sitenamekeys = /ABC DEF GHI/;

and $fromdevice could be something like "device1.abc" or "device2.def"
basically I am trying to get the grep to identify if the current $fromdevice has anything that matching any of the elements in @sitenamekeys

So "device1.abc" or "device2.def" would be a match and therefore would continue without next but something like "device1.xyz" would not match and therefore next would be executed.

Any help is appreciated.

Cheers,

Noah

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to