in reply to How can I store two values with the same key in a hash?

How can i store two Via in the two keys(Via and Via1) of hash. So that when i will give print $cnf{Via};
  1. PLEASE put the subject of your posts in their Subject;
  2. The two "Via" lines match the same regex, thus I would change the logic of the program to record all possible matches instead of storing the last one, i.e. possibly change
    $cnf{$c}=$_;
    to
    push @{ $cnf{$c} }, $_;
    of course you may need a more complex setup such that entries that can only occur once are stored as plain scalars and entries that can occur multiple times are stored as arrayrefs.
  3. the code you posted seems to suggests the reuse of someone else's code with very few clues about what it really does, thus I recommend getting acquainted with at least the very basics of Perl as you may find in any introductory book or tutorial.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.