in reply to formatting question

Since you are mostly working with arguments the best option might be to simply change your strategy altogether and use Getopt::Long instead:

use Getopt::Long; my ($oneDayFlag, $someDate); my $result = GetOptions ( 'oneday=i'=>\$oneDayFlag, 'somedate=s'=>\$someDate ); ...

Celebrate Intellectual Diversity