Tom/A.R., I owe you both an appology. You guys are correct, my origional statement is different than what I was trying to say. Thank you both so much. Bill -----Original Message----- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: beginners@perl.org Sent: Mon, 26 Feb 2007 1:10 PM Subject: Re: BInding operator fails
On 2/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Tom your code works fine. But I was tring to understand why "!~" fails > above. > > if ($result !~ /$rdns/ix) { > > That's checking whether $rdns, as a pattern, does not match the string > in $result. That's why it "fails": It does not mean what you think it means. It means, use $rdns as a pattern, to try to match the string in $result. Then it returns false if the match succeeded or true if the match failed (just the boolean opposite of what =~ would have done). Here's another way to write it: if (not ($result =~ /$rdns/ix) ) { But you originally said "I want to make sure $result is NOT part of $rdns." That's not the same as making sure that $rdns is not part of $result. Does this clear things up? Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ ________________________________________________________________________ Check out the new AOL. Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more.