use perl to parse options instead of getopt