Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Useless use of string eq

by sh1tn (Priest)
on Dec 06, 2007 at 14:48 UTC ( #655421=note: print w/ replies, xml ) Need Help??


in reply to Useless use of string eq

In addition - you can achieve this assignment in one step:

$cust = (split(/-/, $ARGV[1]))[1];



Comment on Re: Useless use of string eq
Download Code
Re^2: Useless use of string eq
by grinder (Bishop) on Dec 06, 2007 at 17:22 UTC

    That may admit bogus customers that don't exist, or that the program cannot deal with. It may be wiser to spell out exactly what is legal.

    (my $cust = $ARGV[1]) =~ s/^-(SMC|SBM|FET|China)$/$1/ or die "garbage in second arg: <$ARGV[1]>\n";

    • another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-07-07 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls