http://qs321.pair.com?node_id=1138613


in reply to sprintf number to string

Should this
if ($count =~ /\n$/) {chomp($c);}
be this
if ($c =~ /\n$/) {chomp($c);}
(or really just chomp; no need for the condition there I think)

The way you have it now, $c will still have the newline at the end.