"Dude," that's not even close to the question. The format function only sets up static format. If you don't know the sizes of your columns ahead of time, you're (mostly) stuck. Even perl6's formats are still largely stuck in the same mindset, despite being much more flexible. The OP is asking if there is anything out there that will determine how many columns are needed, and automagically set up a nice table. See the 'ls' command on unix for an example. Even 'dir' on Windows, with the /w flag, is close.
For the most part, I've just made do with Text::Table. But it is an interesting problem. I would actually try using Text::Table, feeding it the screen width (which you can get with Term::Screen), and just keep adding columns until things don't fit. But that would definitely be slower than a more direct approach.
If the OP is really interested, you might be able to find the source to the ls command and reimplement that algorithm in Perl. The implementation side probably will be easier in perl than C, it'll be the deciphering of the ls code that will be the hard part ;-)
|