in reply to Char counting

$num = $s =~ tr/\n// counts the newlines and is pretty cheap...