in reply to catch the output of a command

You are looking for backticks. The single line:      @connectInfo = `netstat`; ought to produce the same result as your code. Or:      @connectInfo = qx(netstat); means the same thing. Go to perlman:perlop and search for the second occurance of 'qx' to read a full discussion.

Update: Note that the phrase "You're confusing the purpose of system()..." in tachyon's response is not directed at you. It is directed to the question it follows. You have used system() in a correct manner to produce a working but (as you suggested) un-Perlish bit of code.

HTH... david