in reply to Re: format output from a exe within a perl script
in thread format output from a exe within a perl script

elsifs are misplaced here for OP wants to know about things in addition to the host.

Later turns out it was my comment which was misplaced not elsif.

Replies are listed 'Best First'.
Re^3: format output from a exe within a perl script
by pc88mxer (Vicar) on Apr 02, 2008 at 07:02 UTC
    I'm sorry if it wasn't clear, but I intended to keep the for loop and only replace the separate if statements with a single if/elsif/elsif/... statement, i.e.:
    for (@PORTS) { ($KEY, $VAL) = split(/:/); if ($KEY =~ /Host/) { $HOST = $VAL; } elsif ($KEY =~ /Connection time/) { $CONNTIME = $VAL; } elsif ... }
    Is that what you're referring to?
      Thanks for the clue bat. I missed to read your post carefully before my reply, namely I missed the creation of "KEY" in a loop.