Well, if these are the only things on the command line that are not specified as parameters, they should still be in @ARGV. So just use @ARGV.
use Getopt::Long;
GetOptions( 'host=s' => \my $host
, 'user=s' => \my $user
, 'pass=s' => \my $pass
);
cm. Getopt::Long
source
share