--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> On May 31, Paul said:
>
> >> my @chars = $string =~ /\S/g;
> >
> >I've seen a couple of people doing this, and maybe I'm just
> confused,
> >but....
> >
> >Isn't the point of the original request to split into the original
> >characters, but leave *out* the spaces?
> >
> >and isn't \S any nonspace?
> >
> >So, if you split on \S, won't it give you just the strings of
> >whitespace as the elements returned?
>
> Well, sure, if you split() on \S.
>
> @ws = split /\S/, $string;
>
> But we're not split()ing. We're matching all non-spaces.
>
> my @non_ws = $string =~ /(\S)/g;
>
> Or, since a global pattern match in list context without ()'s will
> return the entire match:
>
> my @non_ws = $string =~ /\S/g;
>
> This will be an example in my book.
Ok. That's cool, and I should have gotten that on the first read, but
it's worthy of explication. =o)
Still, though, won't that return all the *strings* as elements, rather
than the individual characters? and wouldn't \S* solve that difference?
Also, please make darned sure you post when this book is available.
I'd like to put some money in your pocket. :o]
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/