#!/usr/bin/perl # # cities - lookup cities in a list, take partial inputs # use warnings; use strict; my $myCities = "Baltimore:Chicago:Los Angeles:New York:San Diego:"; my @myCities = split(':', $myCities); my $warning = "I'm sorry,we no longer tour LA, please try again."; my $prompt = <"; while ( my $input_city = ) { chomp $input_city; print "$warning\n" if ( $input_city eq "Los Angeles" ); foreach my $city ( @myCities) { print "Found $input_city\n" if ( $input_city eq $city ); } print ">"; }