use strict; use warnings; use Getopt::Long; my %args; GetOptions ( 'i|txtpatid=s' => \$args{txtpatid}, 'p|txtpatpw=s' => \$args{txtpatpw}, 's|txtpatserver=s' => \$args{txtpatserver}, ); for (keys %args){ print "$_: $args{$_}\n"; }