Port User Host/Inet/Dest Type Dir Status Start Idle ---- --------------- ---------------- ------- --- ------------- ------ ------ C0 - - Login In USERNAME 0 0 S0 aaaaaa aaaaa Netwrk In ESTABLISHED 4:08 5 S1 bbbbbb bbbbb Netwrk In ESTABLISHED 1:01 1 S2 - - Log/Net In IDLE 0 0
And so on. Say the above is $sessions1. What I need to do is split $sessions1 on the newline, and then split the results of that by the columns above.
And I need to do this for each element of the array, in one big glorified loop which basically allows me to take the pretty plain text thing up there, munge it with another array of plain text thing, and spit it all out in beautiful HTML. Make sense?
(Note: I've tried playing around with getting each newline into a separate array element - I've pulled my hair out trying. Perhaps you could solve that too <g>... I'm using Net::Telnet to telnet to a terminal server, issue a command, press return 3 times, and suck all the information into an array. No matter how much I try though, I can either get all the information plopped into three array elements in the form above, or only the first screen of information plopped into individual array elements.)
In reply to Looping through a split() and more... by morbus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |