Re: Problem with or function

2008-08-07 Thread Rob Dixon
chiel wrote: > > I have a quick question. I use the following line, and this works ok: > > if ($$result_t{$operating_descr.".".$index} =~ /PCMCIA/ && $tmp_status == 3) > { > > > > But if I change it to the following: > > if ($$result_t{$operating_descr.".".$index} =~ /PCMCIA/ || /USB/ && > $

Re: Problem with or function

2008-08-07 Thread Jeff Pang
chiel 写道: > > if ($$result_t{$operating_descr.".".$index} =~ /PCMCIA/ || /USB/ && > $tmp_status == 3) { > Hi, =~ is going with higher PRI than ||. $x =~ /Y/ || /Z/; is the same as: $x =~ /Y/ || $_ =~ /Z/; so you should say: $x =~ /Y|Z/; or, $x =~/Y/ || $x =~/Z/; HTH. -- To unsubscr

Problem with or function

2008-08-07 Thread chiel
Hello, I have a quick question. I use the following line, and this works ok: if ($$result_t{$operating_descr.".".$index} =~ /PCMCIA/ && $tmp_status == 3) { But if I change it to the following: if ($$result_t{$operating_descr.".".$index} =~ /PCMCIA/ || /USB/ && $tmp_status == 3) { I ge