use Getopt::Long qw(GetOptions); my ($A, $B) = (400, 0.2); # default values if not passed as arguments GetOptions('A:f' => \$A, 'B:f' => \$B);