Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Long array -> multiple columns?

by halley (Prior)
on Jan 30, 2008 at 15:21 UTC ( #665144=note: print w/replies, xml ) Need Help??


in reply to Long array -> multiple columns?

There is a common Un*x tool called column that can do this job, and if you're familiar with the Un*x directory listing command ls, then you're probably familiar with the multiple-column output that it produces.

I just looked at the C source code to this utility, and it's an ugly mess. Small and efficient, possibly, but not particularly literate. It looks like someone thought that a robo-indenting tool made code readable, because everything is indented consistently but there's nary a comment to explain how it works.

This is something I thought I had seen on CPAN, but I guess Text::Table is a bit different in purpose.

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re^2: Long array -> multiple columns?
by ikegami (Pope) on Jan 30, 2008 at 21:40 UTC
    One advantage of ls's method (and presumably column's) is that it resizes the columns to fit what will be placed in them and takes into account the width of the terminal.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665144]
help
Chatterbox?
[hippo]: Loudest gig I can recall was Wolfsbane at the Astoria in the early 90s. Head rang for about 3 days afterwards. They were top, though.
[johngg]: My ears are still ringing!
Discipulus was outside The Clash concert in 1985..
[marto]: Wolfsbane , now I'm having flashbacks
[choroba]: Isn't Using PerlPod Creatively rather a meditation?
[choroba]: I don't see a question
[1nickt]: ugh, I stuck my head in the bass bin for 30 seconds on a dare at Ted Nugent at Hammersmith Odeon. Yes, I am 40% deaf now.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-24 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.