in reply to Re: hash question..
in thread hash question..

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?

Replies are listed 'Best First'.
Re^3: hash question..
by toolic (Bishop) on Nov 22, 2007 at 16:13 UTC
    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!!