use Getopt::Long; my @chk; GetOptions('nodelist=i{4}' => \@chk); print "@chk \n";