my $fct_openPort = (join ',',$fct_host_obj->tcp_ports('open'))."\n" ; my @fct_ports = split ',', $fct_openPort; for my $fct_port (@fct_ports) { my $fct_svc = $fct_host_obj->tcp_service($fct_port); my $fct_service = $fct_svc->name() ; print "\nservice : $fct_service \n" ; print "port : $fct_port \n" ; print "service and port = $fct_port:$fct_service \n" ; }