use strict; use warnings; use Getopt::Long; use Data::Dumper; my %options; GetOptions( \%options, 'length|height=i', ); print Dumper \%options; #### E:\>go.pl --height=1 $VAR1 = { 'length' => 1 }; E:\>go.pl --length=1 $VAR1 = { 'length' => 1 };