in reply to Re: using multiple input files
in thread using multiple input files

it appears I almost succeeded. I have already changed the code to the below, but it still doesn't quite process it the way I want. Here is what I have for the code:
print HDLCGET "\#\!\/usr\/local\/bin\/expect\n"; print HDLCGET "set timeout -1\n"; open(MYINPUTFILE, "hdlc2"); open(MYINPUTFILE1, "hdlc3"); while(<MYINPUTFILE>) { my($line) = $_; chomp($line); while(<MYINPUTFILE1>) { my($line1) = $_; chomp($line1); print HDLCGET "spawn \ ssh $line\n"; print HDLCGET "expect \"assword: \"\n"; print HDLCGET "send \"$tacacspw\\r\"\n"; print HDLCGET "expect \"#\"\n"; print HDLCGET "send \"terminal length 0\\r\"\n"; print HDLCGET "expect \"#\"\n"; print HDLCGET "send \"show xconnect all | inc $line1\\r\"\nexp +ect \"#\"\n"; print HDLCGET "send \"exit\\r\"\n"; print HDLCGET "interact\n"; } } close(MYINPUTFILE); close(MYINPUTFILE1);
Now, the problem: while it does properly process the second input file (hdlc3), it won't move to to the second line of the first input file (hdlc2). Basically, what I'm trying to do is to have it do is process line of of file 1 and 2, then line two of file 1 and 2, etc. Any ideas?