I just want to express to everyone how much I love these mailing lists. I've learned so many ways to refine my code in just the past few weeks... it's amazing. Take the below example. I've got it down to 2 "real" lines now... one to load the data, one to print the desired results. Take an amazing tool and get some amazing minds to talk about it and the results are unimaginable. Thanks all for both the solutions, and the questions.
Chris P.S. Here's my current solution for this question: use strict; use warnings; $_ = 'Quincy, IL; Heath, OH; Bowling Green, KY; Muncie, IN; Paducah, KY; Gastonia, NC'; print $_=join '; ', grep {/KY$/} (split /; /); __END__ > -----Original Message----- > From: Carl Jolley [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 24, 2002 2:33 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: String Parse > > > On Tue, 24 Dec 2002 [EMAIL PROTECTED] wrote: > > > H'lo, g'morning Perl People - and Merry Christmas! > > > > I've got a couple quickie questions that are messing me up. They > > should be relatively easy, but I guess since I've been up since > > YESTERDAY working on this, my brain isn't cooperating now. I'm no > > master programmer, I'm just trying to modify a script I > bought to be, > > well, BETTER. > > > > 1) If my program gets a result in a string, and the > string's value is: > > > > Quincy, IL; Heath, OH; Bowling Green, KY; Muncie, IN; > Paducah, KY; Gastonia, NC > > > > How do make it so that the strings value is only those > cities in Kentucky? > > (the string would now be set to just "Bowling Green, KY; > Paducah, KY") > > > > Try: > > $cities="Quincy, IL; Heath, OH; Bowling Green, KY; Muncie, > IN; Paducah, KY; Gastonia, NC"; > @ky=grep {/KY$/} split(/;/,$cities); > print "@ky","\n"; > > **** [EMAIL PROTECTED] <Carl Jolley> > **** All opinions are my own and not necessarily those of my > employer **** > > _______________________________________________ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs