Re: how to use grep to match elements of an array

2010-09-16 Thread Uri Guttman
>> I am trying to figure out how to use grep in a particular situation. >> The line is: >> >> next unless grep ($fromdevice, @sitenamekeys); JJ> next unless grep $fromdevice =~ /$_/, @sitenamekeys; > "JJ" == Jones, Jennifer writes: JJ> I have a question to John's response. T

RE: how to use grep to match elements of an array

2010-09-16 Thread Jones, Jennifer
I have a question to John's response. The code works if the condition is met but responds with "Can't "next" outside a loop block at" when it does not. Can someone please explain why? Thanks, Jen Noah wrote: > Hi there, Hello, > I am trying to figure out how to use grep in a particular si

Re: how to use grep to match elements of an array

2010-09-14 Thread John W. Krahn
Noah wrote: Hi there, Hello, 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 "dev

Re: how to use grep to match elements of an array

2010-09-14 Thread Shawn H Corey
On 10-09-14 11:23 AM, Noah wrote: 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.

Re: how to use grep to match elements of an array

2010-09-14 Thread Shlomi Fish
Hi Noah, On Tuesday 14 September 2010 17:23:09 Noah wrote: > 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 G