use Tk; use Tk::Font; $w=MainWindow->new; $f=$w->Font; $f->measure("hallo" x 400)