[EMAIL PROTECTED] writes:

> Here's another solution:
> 
>       $foo = '1.2.3a-4b.5.c6';
> 
>       $foo =~ s/\W//g;
> 
>       while ($x = chop ($foo) ) {
>        unshift @foo,$x;
>       }

Unfortunately, this code is buggy;  it breaks when versions utilize
numbers greater than 9 or multi-character strings.  For example, it
doesn't work with "21.1.12" or "6.86abc".

> 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;
>       }

Same problem here too.


Sorry.

--kevin
-- 
Kevin D. Clark (cetaceannetworks.com!kclark)  |   Will hack Perl for
Cetacean Networks, Inc.                       |  fine food, good beer,
Portsmouth, N.H. (USA)                        |       or fun.
alumni.unh.edu!kclark (PGP Key Available)     |


**********************************************************
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