Hello Michael,
> I have compiled in Expect and dependent modules into perl,
> but can't get even the simplest example script to run.
> We are running perl on HP-UX10 on a HP-N1000 system.
> When I debug it I get the following error:
>
> spawn(/opt/perl5/lib/site_perl/5.005/Expect.pm:110):
> 110: unless (defined ($pid)) {
> DB<1> Expect::spawn(/opt/perl5/lib/site_perl/5.005/Expect.pm:110):
> 110: unless (defined ($pid)) {
> ######### Forked, but do not know how to change a TTY. #########
Very odd. I have used Expect.pm in HP-UX 10.20 on one clients' site with no
problems.
I know that pty allocation is a bit of a black art, so maybe you are running
into something specific to your environment.
Have you tried:
* Running the same test script as the root user (assuming that this is
possible for you). This once helped narrow down a similar pty issue for me
in FreeBSD, where, for some reason, I could not allocate pty's unless I
was the super-user.
* Using the tcl expect tool to debug, ie: if you happen to have the "expect"
program installed on your machine, you can just type "expect" and when
it gives you a prompt, enter "spawn sh". If pty allocation is OK on your
machine, then this test should return a process id. Then at least you
would know that the problem was with your Expect.pm implementation.
* Try a *really* simple test in perl, such as:
perl -MExpect -e '$e = Expect->spawn("sh") ; print $e->pid()'
On my system, this returns a PID.
Good luck.
Regards,
Simon Taylor
--
Unisolve Pty Ltd - Melbourne, Australia
+61 3 9568 2005
|