On 2/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi. I have a problem with the below code. I have two strings, $rdns and $result1. I want to make sure $result 1 is NOT part of $rdns. But the below fails...thus instead of printing the else part of the if-else-loop. It print the main part. Does anyone know what coudl cause this.
if ($result !~ /$rdns/ix) {
That's checking whether $rdns, as a pattern, does not match the string in $result. (Was that supposed to be $result1?) But I think you're asking for this, maybe: if (index($rdns, $result) == -1) { print "\$result isn't part of \$rdns.\n"; } The index function is covered in perlfunc. Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/