I am running a exe within the perl script. Below is the exe when ran in cmd.
Tools4ever Port Ping Utility. Version 2.05 Copyright (c) 2002 Tools4ever bv. All rights reserved. www.tools4ever.com
Host: 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.
Here is the perl code
my(@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;
I want the perl script to basically comma delimit host, connection time, ect. and to delete the first 3 lines of the output

In reply to format output from a exe within a perl script by swartzieee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.