In a message dated: Fri, 05 Jan 2001 11:58:33 EST
"Kevin D. Clark" said:

>>I'm after the list (1, 2, 3, a, 4, b, 5, c, 6).
>
>  $_ = qq(1.2.3a-4b.5.c6);
>
>  push @array, $1 while(/([a-zA-Z]+|\d+)/g);
>
>I can think of convoluted ways to do this too, but I'm not sure that
>they're worth the effort.

Here's another solution:

        $foo = '1.2.3a-4b.5.c6';

        $foo =~ s/\W//g;

        while ($x = chop ($foo) ) {
         unshift @foo,$x;
        }

Also, you could do something funky like replace the while loop with a for loop:

        for ($i = 0;$f = substr ($foo,$i,1);$i++) {
          push @foo,$f;
        }

Granted, by now you've already solve the problem, but like I said before,

                        TIMTOWTDI

;)

-- 

Seeya,
Paul
----
           I'm in shape, my shape just happens to be pear!

         If you're not having fun, you're not doing it right!



**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to