in reply to Merging hashes at key match

Please see How do I post a question effectively? and http://sscce.org/ - it would be much easier to answer your question if you could provide sample input data, a minimal code example that compiles, and some expected output corresponding to the example input.

Anyway, it seems like the line you are asking about is push $HASH{$MACS[$mac]}, [$VLANS[$vlan], [$INTS[$int]]; - it looks like you're trying to push an array reference ([$VLANS[$vlan], $INTS[$int]]) onto the value of $HASH{$MACS[$mac]}, but what is unclear from your code is what kind of a data structure that contains. Since you're using push, I'm going to guess it's an array reference. In that case, you need to dereference the array reference first via push @{...}, ...;, or in your case:

push @{ $HASH{$MACS[$mac]} }, [$VLANS[$vlan], $INTS[$int]];

But whether that'll get you the data structure you want depends on what you want your output data structure to look like, which you haven't shown us.

The document perldsc is a nice cookbook of code examples for Perl data structures that will very likely help you.

Replies are listed 'Best First'.
Re^2: Merging hashes at key match
by GeorgMN (Acolyte) on Mar 22, 2016 at 15:19 UTC
    Hello - I updated the code field. Maybe you can take another look. Thank you - Georg