From: <Wu...@in...> - 2003-08-20 04:02:35
|
Hi, =20 I'm having this problem. I know we can use subroutine in this way, =20 [ timeout =3D> sub{$exp->send("quit\n");}], =20 or call a subroutine in this way, =20 [ qr/SQL>/i =3D> \&dothis ], =20 but I want to pass parameters along with the subroutine call, so I write in this way, =20 [ timeout =3D> sub{$exp->send("quit\n");}], [ qr/SQL>/i =3D> \&dothis(param) ], =20 but it generated such error message: =20 "Pattern #2 doesn't have a CODE referenceafter the pattern" =20 Then the timeout in 1st line cannot work, although the subroutine did receive the parameter. =20 So that means I cannot pass any parameters within Expect statement. How can I solve this problem? Thanks. =20 =20 Liang =20 |