in reply to hash question..

As a debug step try printing the contents of all your variables:
print "line contains:\n"; print Dumper(\@line); print "File2 contains:\n"; print Dumper(\%File2); print "File3 contains:\n"; print Dumper(\%File3);

I believe "$line[3]" is the same as $line[3]. So, you should expect them to behave the same.

Replies are listed 'Best First'.
Re^2: hash question..
by wst (Acolyte) on Nov 22, 2007 at 15:56 UTC
    I did do that, and yet I do not see same behaviour.
    When I do
    print Dumper{$File2{"00003200"});

    I do get the value for that key!.

    What am I doing wrong here?

      Please add these 2 lines to your script, then run your script, then post the output of your script so that we may all see the contents of the @line array:
      print "line contains:\n"; print Dumper(\@line);

      It will be useful for the rest of to know if this is a simple array, or an array of arrays, or an array of hashes, etc. And we will be able to see if there is even a 4th element of the array.

      If the File hashes are not too big, please also post their contents.

      Also, make sure you are using the strictures (use warnings; use strict;), as these may help to point out undefined or unititialized variables.

        toolic: I do use warnings;use strict Well it turns out to be even simpler than that. When I was reading from the flat files, (using substr), I somehow have spaces in my key. Thus I was not able to find a match.

        I was not able to see the spaces but when I did (something similiar to what SuicideJunkie suggested.)
        print "{$line[3]}";
        I noticed the spaces and that explained why I was not able to have my if statement be satisfied.

        Thanks for all the help and time to everyone!!