in reply to Hash of Arrays

Something like:
use strict; use warnings; use Data::Dumper; my %hash; while (my $line = <DATA> ) { chomp $line; my ( $key, $value ) = split /\s*::=\s*/, $line; if ( $key and $value ) { push @{$hash{$key}}, $value; } } print Dumper \%hash; __DATA__ A::=B C::=D A::=C

This assumes one entry per line. If there can be more than that, you'll need to explain what delimits each entry. The conditional (if) is just a very simplistic approach toward rejecting blank lines or mismatched key/value pairs. I also added the flexibility of allowing whitespace between the key, the ::=, and the value. As you can see when you run this snippet, my solution creates what you asked for, a hash where each element is an array of values for the appropriate key.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein