in reply to using Getopt::Long, arguments and no arguments possible?

This is yet another reason why I like the "store options in a hash" ability:

#!/usr/bin/perl use strict; use warnings; use Getopt::Long; my %args; GetOptions(\%args, 'adduser:s@'); use Data::Dumper; print Dumper(\%args);
When used, this shows:
$ perl ./a.pl $VAR1 = {}; $ perl ./a.pl --adduser $VAR1 = { 'adduser' => [ '' ] }; $ perl ./a.pl --adduser blah $VAR1 = { 'adduser' => [ 'blah' ] };
So, if the option isn't specified, it doesn't end up as a key in the hash. If the option is specified, but without any parameter, the key shows up, but the value is an array reference containing an empty string. If the option is specified with a parameter, then the key is there, pointing to an array containing the parameter. Note that --adduser and --adduser "" both do the same thing. Which is probably fine.