Need help in parsing an input in perl

view full story

http://www.unix.com – I am executing a command it is returning me something like this Code: name ip port ------------------------------------ http-listener-1 * 6712 http-listener-2 * 8709 I have a subroutine getListenerName($porttobeChecked) This subroutine returns me the name of the listener if i pass a port. Eg:If $porttobechecked=6712 I want to return an array a[0]=TRUE and a[1]=http-listener-1(listener name) If port to be checked is 4516..I want to return an array a[0]=FALSE and a[1]=null How can i parse this output.Any help appreciated? (HowTos)