swartzieee has asked for the wisdom of the Perl Monks concerning the following question:
Tools4ever Port Ping Utility. Version 2.05 Copyright (c) 2002 Tools4ever bv. All rights reserved. www.tools4ever.com
Here is the perl codeHost: localhost Connection time: 985 ms Connected host: - Connected port: -1 Error code: 10061 Error text: Error 10061 connecting socket. No connection could be made + because t he target machine actively refused it.
I want the perl script to basically comma delimit host, connection time, ect. and to delete the first 3 lines of the outputmy(@PORTS); my($app); @PORTS= qx {C:\\t4ecltbundle\\T4ePortPing localhost 3232}; for(@PORTS){ ($KEY,$VAL)=split(/:/); $HOST=$SITVAL if $KEY =~ /Host/; $CONNTIME=$SITVAL if $KEY =~ /Connection time/; $CONNEDHOST=$SITVAL if $KEY =~ /Connected host/; $CONNEDPORT=$SITVAL if $KEY =~ /Connected port/; $ERRCODE=$SITVAL if $KEY =~ /Error code/; $ERRTEXT=$SITVAL if $KEY =~ /Error text/; } print "$HOST,$CONNTIME"; exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: format output from a exe within a perl script
by GrandFather (Saint) on Apr 02, 2008 at 02:35 UTC | |
|
Re: format output from a exe within a perl script
by jwkrahn (Abbot) on Apr 02, 2008 at 02:34 UTC | |
|
Re: format output from a exe within a perl script
by pc88mxer (Vicar) on Apr 02, 2008 at 02:30 UTC | |
by parv (Parson) on Apr 02, 2008 at 03:40 UTC | |
by pc88mxer (Vicar) on Apr 02, 2008 at 07:02 UTC | |
by parv (Parson) on Apr 02, 2008 at 07:48 UTC | |
|
Re: format output from a exe within a perl script
by kyle (Abbot) on Apr 02, 2008 at 02:47 UTC |