Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Useless use of string eq

by NetWallah (Canon)
on Dec 07, 2007 at 15:17 UTC ( #655668=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://655668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2022-01-29 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?