in reply to Re^3: extract line
in thread extract line

What does the line $partNumber{$_} = 1; d?

It runs but the output is incorrect. When I print $partNumber{$_} I get 1, the values assigned instead of the part number

Replies are listed 'Best First'.
Re^5: extract line
by frozenwithjoy (Priest) on Jul 21, 2013 at 16:38 UTC
    It is used for populating the part numbers hash. The part number is the key and '1' is the associated value. The '1' doesn't matter. You just want to have a hash with part numbers as the unique keys of the hash since you can quickly and easily check to see if a key exists in a hash. For example:
    print "$key exists in hash" if exists $hash{$key};