grouping hashrefs to trees

M

Matija Papec

I need to group hashrefs into branches where every instance in branch has
something in common with others. The problem is that no one can tell which
attribute will be dominant, so I guess there should be some counting before
actual grouping into branches. Please tell me that somebody already has
invented the wheel. :)


my @rules = (
{
'source-port' => 23,
protocol => "tcp",
},
{
source => '6.11.6.6/24',
},
{
protocol => 'udp', 'source-port' => 53,
source => '64.11.6.6',
},
{
protocol => 'udp', 'source-port' => 53,
source => '164.11.6.6',
},
{
protocol => 'udp', 'source-port' => 53,
source => '164.11.6.7',
},
{
protocol => 'udp', 'source-port' => 53,
source => '164.11.6.8',
},
);
 
B

Ben Morrow

Matija Papec said:
I need to group hashrefs into branches where every instance in branch has
something in common with others. The problem is that no one can tell which
attribute will be dominant, so I guess there should be some counting before
actual grouping into branches. Please tell me that somebody already has
invented the wheel. :)

You may find Data::Favorites helpful.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top