in reply to Use of uninitialized value warning on print

Looking at your code I would guess that getservbyport() is returning undef which means that $svcwatch will also be undefined. Try adding the following to be sure:

my $svcwatch = ( $name !~ /^#/ ) ? getservbyport ( $port, $proto ) : next; if (! defined $svcwatch) { warn("getservbyport return undef"); }
-- vek --