in reply to pattern match showes true

!= performs a numerical comparison. Since both DISK:\db2_backup\ and USEREXIT evaluate to zero in numerical context, they are numerically equal.

You want ne which performs a lexical comparison.

Ref.: perlop

Replies are listed 'Best First'.
Re^2: pattern match showes true
by Anonymous Monk on Jul 30, 2007 at 20:34 UTC
    Hi Thank you for your reply. I tried the 'ne' option but it still doesnt recognize it. I still have atru when I compare those specific values.
      $siebdb = 'somekey'; $preprod->{$siebdb} = "DISK:\\db2_backup\\"; $prod->{$siebdb} = "USEREXIT"; if($preprod->{$siebdb} ne $prod->{$siebdb}) { print "NOT EQUAL"; } else { print "EQUAL"; }

      outputs

      NOT EQUAL

      You should be getting the same.