in reply to Use of uninitialized value in print

Here's one that works:

#!/usr/bin/perl use strict; use warnings; use strict 'vars'; use Getopt::Std; #Setting options # u:username # h:hostname # p:password # k:SSH Key getopts("u:h:p:k:"); our ($opt_u, $opt_h); #### TEST SECTION ### print "opts::$opt_u\n";

In your version, you refer to $opts::opt_u, which is a package variable in the "opts" package. strict won't complain about that because you've given the full name of the package variable, but that doesn't change the fact that there's nothing in it. Your call to getopt will set $main::opt_u instead (because that's what package it's called in).