Anyone who has tried to parse command-line options in Perl knows how messy the process gets with increasing number of options. Luckily, there are some modules that the whole process more manageable. The tutorials I am learning from are http://systhread.net/texts/200704optparse.php#one and http://aplawrence.com/Unix/perlgetopts.html . Without using a special Perl module, options can be parsed as follows (credit to http://systhread.net/texts/200704optparse.php#one ) while ( my $arg = shift @ARGV ) { if ( $arg eq '-F' ) { $F_FLAG = 1; } elsif ( $arg eq '-f' ) { $FILE_ARGUMENT = shift @ARGV; } elsif ( $arg eq '-u' ) { usage(); } else { usage(); exit 1; } } Ultimately, using the getopt module should be done if it is available, why reinvent the wheel? Here is an example of using the Getopt module: use Getopt::Std; ... getopt ('f:uF'); die "Usage: $0 [ -f filename -u ]\n" unless ( $opt_f or $opt_u ); if ($opt_f) {...