in reply to Re^3: Attempting to fill a hash
in thread Attempting to fill a hash

Added that plug in and ran the code. (I used a majorly slimmed down version of the text file for this example.) Here are the results This is what is in the text file in order:
a aah aahed aahing aahs aardvark aardvarks aardwolf ab This is what Dump returned $VAR1 = { ' => 1, 'a ' => 1, 'aahed ' => 1, 'aahs ' => 1, 'aardwolf ' => 1, 'aahing ' => 1, 'aardvark ' => 1, 'aardvarks ' => 1, 'ab ' => 1 'aah };
I notice both the vales and the keys are there, however when i do. print "$hashlist{a}\n"; it returns null followed by a \n. they are also out of order, but for the use I have in mind that is unimportant as long as they all read.

Replies are listed 'Best First'.
Re^5: Attempting to fill a hash
by toolic (Bishop) on Jun 06, 2008 at 01:31 UTC
    they are also out of order
    As expected, according to the documentation (perldata):
    Note that just because a hash is initialized in that order doesn't mea +n that it comes out in that order. See sort for examples of how to ar +range for an output ordering.