http://qs321.pair.com?node_id=655668


in reply to Useless use of string eq

If you installed the new perl 5.10, you could do something like:
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 nec +essary like::: when (/china/i) {$cust='China';} default { say 'Invalid customer'; } }

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom