Ok, another attempt, this time with brain engaged and coffee consumed. > $str = join ', ', @names; > if (length($str)>90) { > ($str = substr($str,0,90)) =~ s/,[^,]*$/, etc./; > }
my ($i, $total); ($total += length) < 90 ? $i++ : last for @ARGV; $str = join ', ', @ARGV[0 .. $i]; $str .= ', etc' if $i < $#ARGV; -- Regards, Aristotle