Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!marvit From: marvit@hplpm.hpl.hp.com (Peter Marvit) Newsgroups: comp.lang.perl Subject: Re: Capitalizing words in a line. Message-ID: Date: 20 Feb 91 20:20:37 GMT References: Sender: news@hplabs.hpl.hp.com (placeholder for future) Organization: Hewlett-Packard Laboratories, Palo Alto, CA Lines: 15 In-Reply-To: marvit@hplpm.hpl.hp.com's message of 13 Feb 91 19:09:35 Thanks to Bill Mann and Tom Christiansen who provided solutions to "how to capitalize words on a line." Their nearly identical codes: s/\b([a-z])/$b=$1,$b=~tr:a-z:A-Z:,$b/ge; AND s#(\b.)#($x = $1) =~ tr/a-z/A-Z/, $x#ge; both operating on $_, of course. I find the second to be a bit "trickier" to read, but both work just fine. -Peter "knit one, perl two" Marvit : Peter Marvit Hewlett-Packard Labs in Palo Alto, CA (415) 857-6646 : : Internet: uucp: {any backbone}!hplabs!marvit :