while (my $line = <$FH>) { next if $line =~ /^-----/; my ($name, $ip, $port) = split /\s+/, $line; print "Name: $name, IP: $ip, Port: $port\n"; }