Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: **HomeWork** Trying to search an array and match it to a user input

by Arif (Acolyte)
on Mar 27, 2008 at 18:06 UTC ( #676820=note: print w/replies, xml ) Need Help??


in reply to Re: **HomeWork** Trying to search an array and match it to a user input
in thread **HomeWork** Trying to search an array and match it to a user input

You can also take a look at the module Text::Abbrev. It makes it easy to work with abbreviations of strings.
%hash = abbrev (split(':', "Baltimore:Chicago:Los Angeles:New York:San Diego:"));
chomp (my $input_city = <STDIN> );
if (exists $hash{$input_city}) { ...... }
  • Comment on Re^2: **HomeWork** Trying to search an array and match it to a user input

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://676820]
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: (3)
As of 2021-09-26 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?