use feature qw(say switch); given($ARGV[1]) { when ('-SMC') { $cust= 'SMC'; } when ('-FET') { $cust= 'FET''; } # .... add other conditions ... # You can even use Regular expressions (Smart match) here, if necessary like::: when (/china/i) {$cust='China';} default { say 'Invalid customer'; } }