Comm.pl works fine on Linux, not on SunOS 
Author Message
 Comm.pl works fine on Linux, not on SunOS

First I apologize for the errors in my earlier post (cant cut
& paste from openwin app to Xlib app). Anyway, Consider the following
exchange with the perl de{*filter*}:
-------------------------------------------------------------------
  DB<1> print fileno(STDIN)
0
  DB<2> $Debug=1

  DB<3> require "Comm.pl";

  DB<4> &Comm'init();
 *main'open_port = *Comm'open_port
 *main'open_listen = *Comm'open_listen
 *main'open_udp_port = *Comm'open_udp_port
 *main'open_proc = *Comm'open_proc
 *main'send_to = *Comm'send_to
 *main'recv_from = *Comm'recv_from
 *main'accept_it = *Comm'accept_it
 *main'select_it = *Comm'select_it
 *main'expect = *Comm'expect
 *main'interact = *Comm'interact
 *main'close_noshutdown = *Comm'close_noshutdown
 *main'close_it = *Comm'close_it
 *main'stty_sane = *Comm'stty_sane
 *main'stty_raw = *Comm'stty_raw
 *main'stty_ioctl = *Comm'stty_ioctl
OS_type=BSD

  DB<5> $|=1;

  DB<6> $Proc_pty_handle=&open_proc("passme");
getpty: trying pty=/dev/ptype, tty=/dev/ttype
getpty: returning (/dev/ptype,/dev/ttype)
open_proc: mypid=25507, $PIDS{proccommutils000001} = 25525
open_proc: mypid=25525, $PIDS{proccommutils000001} = 0
do_tty_child: ( proccommutils000002, /dev/ttype, passme )
 *main'proccommutils000001 = *Comm'proccommutils000001
 *main'proccommutils000002 = *Comm'proccommutils000002
open_proc returning: pty_handle=proccommutils000001

  DB<7> ($match,$err,$before,$after)=&expect($Proc_pty_handle,30,'word:');
expect: checking pid 25525

  DB<8> print $match

  DB<9> print $err
TIMEOUT
  DB<10> print $before
Should be 0:  fileno(STDIN) = 1 at /home/blair/lib/perl5/Comm.pl line 1121.

  DB<7>
  DB<11> print fileno(STDIN)
0
  DB<12>                    
-------------------------------------------------------------------

Where passme is just:
-------------------------------------------------------------------
#!/home/blair/bin/perl

print "Enter password: ";
while (<STDIN>)
{
        chop;
        if ($_ eq "zing321")
                { print "inflating: whatever.TXT\n"; exit; }
                else { print "password incorrect--reenter: "; }

Quote:
}              

-------------------------------------------------------------------

Now this works fine on my linux box at home but I get the "Should be 0..."
death above on a Sun running SunOS 4.1.3.
Even more peculiar is the fact that fileno(STDIN) really is 0.
Any ideas?
Thanx,
Art.



Wed, 03 Mar 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. system() command not wrking in cgi / works fine in .pl

2. Comm.pl works on Linux?

3. Comm.pl to simlate expect does not work on hp

4. Comm.pl to simlate expect does not work on hp

5. problem with Comm.pl on SunOS

6. Comm.pl good on Linux, bad on HP-UX

7. Comm.pl and Linux

8. Comm.pl and Linux (2.2 or greater)

9. Comm.pl good on Linux, bad on HP-UX

10. Port of Comm.pl to Linux

11. Comm.pl and Linux

12. backticks not working fine on Perl 5 - Windows NT 4.0 peer web server

 

 
Powered by phpBB® Forum Software