Here is a program that works in perl 5.6.1 but it doesn't on mod_perl 1.26.
#!/usr/bin/perl -w
use Expect;
$expect_delay=120;
$system_name = "system";
$system_pass = "thisisthepassword";
$login=Expect->spawn("telnet node.domain.com") or die "Can't start telnet: $! \n";
$login->clear_accum();
$match = $login->expect($expect_delay,"Username:");
print $login "$system_name\r";
$login->clear_accum();
$match = $login->expect($expect_delay,"Password:");
print $login "$system_pass\r";
$login->clear_accum();
$match = $login->expect($expect_delay,'$');
print $login "set term/device=vt100\r";
$login->clear_accum();
$match = $login->expect($expect_delay,'$');
print $login "set process/priv=all\r";
$login->clear_accum();
$match = $login->expect($expect_delay,'$');
print $login "dir\r";
Dear MODPERLers,
I am sorry to trouble you with this, but I am having a problem
with Expect.pm running under Registry.pm. This code has worked
fine on older versions of Apache/mod_perl. i.e.:
[Fri Sep 6 13:58:24 2002] [notice] Apache/1.3.12 (Unix) mod_perl/1.24 mod_ssl/2.6.6
OpenSSL/0.9.6 configured -- resuming normal operations
The problem version and problem log are as follows:
--snip--
[Fri Sep 6 12:56:06 2002] [notice] Apache/1.3.26 (Unix) PHP/4.2.1 mod_perl/1.26
mod_ssl/2.8.10 OpenSSL/0.9.6e configured -- resuming normal operations
[Fri Sep 6 12:56:06 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Fri Sep 6 12:56:20 2002] null: Starting EXPECT pattern matching...
[Fri Sep 6 12:56:20 2002] null: Expect::expect('Expect=GLOB(0x88819e8)', 120,
'Username:') called at /usr/local/apache//apache_lib/H1.pm line 523
--snip--
A portion of the code that I am running is:
--snip--
my $login=Expect->spawn("telnet $node_name");
$login->debug($debug);
$login->clear_accum();
$match = $login->expect($expect_delay,"Username:");
--snip--
It works fine until the expect method is called. It failes to
connect to the remote system and these odd null: line begin
dumping in the error log.
Have you seen anything like this?
Thanks in advance and again sorry for the interruption.
--
--------------------------------------------------
Mark Temple, Information Technology Manager
ABC Labs, Columbia, Missouri 65202
voice:573.876.8198 fax:573.443.9033
--------------------------------------------------