* Selector, Lev Y <[EMAIL PROTECTED]> [2002-11-20 00:55]: > an array of names is converted into a comma-separated list. > if the list gets to long - limit it and add ", etc." at the end. > > $str = join ', ', @names; > if (length($str)>90) { > ($str = substr($str,0,90)) =~ s/,[^,]*$/, etc./; > }
my ($i, $total); ($total += $_) < 90 or last, $i++ for map length, @names; $str = join ',', @names[0 .. $i]; $str .= ', etc' if $i < $#names; -- Regards, Aristotle