From: Prem S. <pre...@ya...> - 2008-01-03 11:59:52
|
I am using a sub routine of expect to be called in by all my testcases. For that, I am planning to send the arguments and based upon the arguments it should expect. proc exp { my @val1 = "@_[0]"; my $val2 = "@_[1]"; my $val3 = "@_[2]"; my $exp = Expect->spawn(@_[0]); $exp->log_file("buffer.txt", "w"); $exp->expect(10000, [ qr'"$val2"', <<<< even though $val2 has that value, here its breaking sub { print "the values are $val1[0],$val2,$val3"; $spawn_ok = 1; my $fh = shift; $fh->send("@_[2]\n"); $fh->send("exit\n"); exp_continue; } ], ); $exppat = "^Enter"; &initexpect($cmd,$exppat,vt100); The problem which I face is whenever I try to substitue a special character within qr, it fails... Any thoughts of how to rectify this problem -- View this message in context: http://www.nabble.com/How-to-substitue-a-value-within-the-expect-qr%27%24val%27-%3C%3C%3C-not-working-tp14595730p14595730.html Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |