} } } } }; #### my @ports = ( { id => 0, ip => "ip1", protocol => "tcp", port => 21, service => "ftp", state => "open", }, { id => 1, ... } ); #### my @open_ports = grep {$_->{state} eq "open"} @ports;