in reply to Re: Use of uninitialized value in print
in thread Use of uninitialized value in print

I have gotten into the habit of checking options using defined just in case 0 is a legal value. The code you show treats 0 as an undefined value.
$ ./test.pl -u 0 $opt_u=Undefined $opt_h=Undefined $opt_p=Undefined $opt_k=Undefined

I realize that in this particular application, 0 is unlikely to be a username, password, etc., but it does not hurt to account for this corner case:

print "\$opt_u="; print defined $opt_u ? $opt_u : "Undefined" ; print "\n";