UNF: while ($waitforit eq "yes") { $cipher = new Crypt::CBC("$cipherkey", 'Blowfish_PP'); $ciphertext = $cipher->encrypt("$msg"); $hash = GenerateMD5("$msg"); print $client "$hash $ciphertext\n"; my ($argh) =0; while (<$client>) { my ($line) = $_; chomp($line); $argh++; if ($line =~ /Resend/) { next UNF; $resend = "yes";} $inhash = substr($line, 0, 32); $encrypted = substr($line, 33, length($_)-33); $plaintext = $cipher->decrypt($encrypted); $checkhash = GenerateMD5($plaintext); if ($inhash eq $checkhash) { if ($plaintext =~ /!!beginresponse/) { print $client "OK\n"; @data=(); next; } if ($plaintext =~ /!!endresponse/) { print $client "Finished\n"; print "Number: $argh\n"; return @data; } if ($plaintext =~ /confline:\s+(.*)/) { print $client "OK\n"; push(@data, $1); } } else { $plaintext = ""; $inhash=""; $encrypted=""; $checkhash=""; print $client "Resend\n"; } } }