Todd Wade wrote: > > John W. Krahn wrote: > > > Todd Wade wrote: > > > > Why remove everything you don't want, why not just capture the data you > > do want? > > sure.... > > >> $weather =~ tr/[A-Z]\n/[a-z] /; > > ^ ^ ^ ^ > > Why are you translating a '[' to '[' and ']' to ']'? Why are you > > translating "\n" to " " when there are no newlines in $weather? > > Youre right about part a, but not part b. There (usually) are newlines in > $weather. Look at the document: > > http://weather.noaa.gov/pub/data/forecasts/zone/oh/ohz021.txt
Yes, I had a look and there are newlines. :-) However it is usually better to use lc() and uc() to change case then using tr///. > > $weather =~ s/(\w+)/\u$1/g; > > This assumes any non alphanumeric character denotes a sentence boundary. $weather =~ s/(^|\.\s)(\w)/$1\u$2/g; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]