while (my $input = <$sock>) {
print "input line: **start**$input**end**\n"; # debugging
if (index($input, "/QUOTE") != -1) {
print " is a match\n"; # debugging
my $str = $input;
($pass) = $str =~ m{/QUOTE\sPASS\s(.*?)$};
print $sock "QUOTE PASS $pass\r\n";
} else {
print " not a match\n" # debugging
}
}
One thing I notice is that you're both reading from and writing to the filehandle in $sock. That might be possible if that's a particular kind of object, but it definitely won't work if it's a normal pipe or filehandle, so it might be a mistake.
Aaron B.
Available for small or large Perl jobs; see my home node.
|