On Tue, Apr 12, 2005 at 09:52:38PM -0500, Rod Adams wrote: : gcomnz wrote: : : >Hey all, not sure if I'm just missing some obvious source of : >information, but I used trim() as a function in a cookbook example, : >then realized that it's not even in S29... : > : >There is a brief mention of trim(), as well as words() (odd as the : >words() function may seem, to me at least), at : >http://tinyurl.com/6fjda but it hardly seems definitive. : > : >Trim sure is handy and would get used a lot, I think. But boy do I : >need to study up on my Unicode: I have such a hard time believing that : >words() is practical for CJK. It sure would be cool I guess, if that : >did work.
A words() function would only be useful for space-separated CJK. : >Any validation on whether either, both, or neither of those functions : >is supposed to exist? : > : > : Well, some form of words() exists... only spelled q:w//, with various : doublings of q and w available, some of which can be spelled <> or «», : though to be honest, I've lost track of how often the meanings of those : as quoters has changed. I suspect S02 or S03 would have that answer. Yes, it's a dup of «$string», so we probably don't need words(). On the other hand, there's no trivially obvious way to trim whitespace from both ends of a string. (Not that «$string» is *entirely* obvious either...) Of course, generations of Perl programmers have made do with various forms of s///, trudging miles through the snow, uphill both ways. : As for whether or not these actually exist, I'd like a bit more : consensus that they are actually needed as builtins. One side of me says : "Hey, we've got them all seperated into different namespaces now, so : we're not really getting polluted, so sure, let's add anything that's in : the least bit useful". The other side of me then starts to say : "bloated". I'm not sure where the balance on this lies, and will yield : to the will of those better at language design than myself. Hmm, where there's a way, there's a will, I guess. Larry