Use this basic program to check your input files
poj#!/usr/bin/perl use strict; use Data::Dumper; $Data::Dumper::Useqq = 1; if( @ARGV < 2 ) { print "Usage: new.pl source destination\n"; exit; } my $file1 = $ARGV[0]; my $file2 = $ARGV[1]; open my $fh1,'<',$file1 or die "Could not open $file1: $!"; my @src = <$fh1>; chomp(@src); close $fh1; open my $fh2,'<',$file2 or die "Could not open $file2: $!"; my @dest = <$fh2>; chomp(@dest); close $fh2; # check data print Dumper(\@src,\@dest); for my $src (@src){ print "Source [$src]\n"; for my $dest (@dest){ my ($servername, $portnumber) = split ',', $dest; print "Destination [$servername:$portnumber] \n"; } }
In reply to Re^5: socket checker in multiple hosts for multiple destination (Perl 6)
by poj
in thread socket checker in multiple hosts for multiple destination
by Bams
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |