|
From: Adrian P. <ad...@po...> - 2000-11-16 11:46:05
|
>>>>> "Adrian" == Adrian Phillips <a.p...@dn...> writes:
>>>>> "Roland" == Roland Giersig <Rol...@al...> writes:
Roland> Adrian Phillips wrote:
>>> The following patch fix a Argument "" isn't numeric in eq
>>> message when calling expect with ["-re", "match"], ie. no
>>> subroutine is given.
Roland> Interesting, somebody else also reported this bug, but I
Roland> cannot reproduce it. What version of perl are you
Roland> running?
Adrian> This is perl, version 5.005_03 built for i386-linux
Adrian> This is perl, version 5.005_03 built for aix
Right. Correct me if I'm wrong, the logig of that section of code is
the following :-
# call hook function if defined
if ($pattern->[3]) {
print STDERR ("Calling hook $pattern->[3]...\r\n",
) if ($Expect::Exp_Internal or $Expect::Debug);
if ($#{$pattern} > 3) {
# call with parameters if given
$exp_cont = &{$pattern->[3]}($exp,
@{$pattern}[4..$#{$pattern}]);
} else {
$exp_cont = &{$pattern->[3]}($exp);
}
}
** So basically we've got here because no callback has been defined,
but $exp_cont is only set to a usefull value if the callback is
defined so the patch I sent moves the following block into the
previous block.
if ($exp_cont == exp_continue
or $exp_cont eq 'exp_continue'
or $exp_cont eq 'exp_continue_timeout'
or $exp_cont == exp_continue_timeout) {
if ($exp_cont == exp_continue
or $exp_cont eq 'exp_continue') {
print STDERR ("Continuing expect, restarting timeout...\r\n",
) if ($Expect::Exp_Internal or $Expect::Debug);
$start_loop_time = time() # restart timeout count
} else {
print STDERR ("Continuing expect...\r\n",
) if ($Expect::Exp_Internal or $Expect::Debug);
}
next READLOOP;
}
The error message is due to $exp_cont being set to "", the first test
is ==, which will always give an error when using -w (if I recall
correctly).
Anyway, thats my take on the problem. Any corrections gratefully
accepted.
Regards,
Adrian
--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]
|