perl -e 'for(0..$#ARGV){($debug,$infile)=(1,$ARGV[$_+1]) if $ARGV[$_]=~/-d/}'