in reply to Re^2: pattern match showes true
in thread pattern match showes true

Do what FunkyMonk said. Also, when you show us what you are doing, you're being just a little bit too terse; seeing larger parts of your actual code might help us help you better (not too large - remove as much as you can while still leaving enough to create the problem).

I can think of three possible problems you might be having, other than simple syntax misuse: one of your strings might have a newline at the end, making them not exactly equal; $prod and $preprod could be referring to different hashes than you expect; $siebdb could be something different than you expect either when storing the values in the hash or when doing the comparison.

We'd really have to see more of your code to tell what's up.

Replies are listed 'Best First'.
Re^4: pattern match showes true
by Anonymous Monk on Jul 31, 2007 at 19:52 UTC
    hi again, I am building two saperate hashes as
    my($q1,$a1) = split(/=/); $prod->{$environment}{$dbname}{$q1} = $a1; my($rt,$ap) = split(/=/); $preprod->{$env}{$database}{$rt} = $ap; and then comparing the values as if ($preprod->{$env}{$database}{$rt} ne $prod->{$environment}{$dbname} +{$q1) { print "$preprod->{$env}{$database}{$rt}\n" }
    I get all the values correct except
    #$a1 is /siebprod/db13/PRODDB/log2/ #$ap is /preprod/db12/PREPRODDB/log2/
      In place of your if, try putting
      use Data::Dumper; $Data::Dumper::Useqq = 1; $Data::Dumper::Terse = 1; print "preprod is at $preprod, env is ", Dumper($env), " database is " +, Dumper($database), " rt is ", Dumper($rt), " value is ", Dumper($pr +eprod->{$env}{$database}{$rt}), "\n"; print "prod is at $prod, environment is ", Dumper($environment), " dbn +ame is ", Dumper($dbname), " q1 is ", Dumper($q1), " value is ", Dump +er($prod->{$environment}{$dbname}{$q1}), "\n";
      and see if anything looks different than you expect.