#!/usr/bin/perl use strict; use Getopt::Mixed; use vars qw|$opt_u $opt_x $opt_m|; # Note that you have to use globals... Getopt::Mixed::getOptions( qq|u=s x:i m:i| ); # Option u wants (mandatory) a string # Option x accepts (not mandatory) an integer # Option m too... die "Hey man, you have to provide an username!\n" unless $opt_u ; print "Option 'u' is $opt_u\n"; #### Getopt::Mixed::getOptions( qq|u=s username>u x:i m:i| );