use Getopt::Long; GetOptions("prefix=s", \$prefix, "prefix-man=s", \$prefix_man); $prefix = defined($prefix) ? $prefix : $default_install_path; $prefix_man = defined($prefix_man) ? $prefix_man : $default_install_man;