in reply to Setting default values in getopts

Aside from jeffa's point about you re-my'ing things, you might want to use something like this instead of multiple assignments:

my %opt = ( d => "x", a => 0, s => 0, e => "x", );