http://www.perlmonks.org?node_id=955220


in reply to Getting length of longest value in a column

Have the database do the work for you:
my $query = <<'SQL'; SELECT ticket_id, abstract, priority, maxlen_abstract FROM (SELECT MAX(LENGTH(abstract)) AS maxlen_abstract FROM t1) AS s1 CROSS JOIN t1; SQL

Pay special attention to what your definition of length should be. You may not be in an ASCII-world.