in reply to Need help in parsing an input
Parsing the strings ought to be easy. It prefaces the interesting data with a bar of hyphens, and the name, IP and port ought not have whitespace. So you can simply read and discard lines until you find the line of hyphens. After that, you can use a simple split to break out the individual fields:
while (my $line = <$FH>) { next if $line =~ /^-----/; my ($name, $ip, $port) = split /\s+/, $line; print "Name: $name, IP: $ip, Port: $port\n"; }
Other alternatives include using substr or unpack for breaking up lines with fixed-length fields.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom