home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!tres
- From: tres@rap.ucar.edu (Tres Hofmeister)
- Subject: chat2.pl Question
- Message-ID: <1992Nov23.215146.2558@ncar.ucar.edu>
- Keywords: &chat'expect, $*, $/
- Sender: news@ncar.ucar.edu (USENET Maintenance)
- Organization: NCAR, Research Application Program
- Distribution: na
- Date: Mon, 23 Nov 1992 21:51:46 GMT
- Lines: 34
-
-
- I'm a bit confused about the behavior of &chat'expect from
- the chat2.pl library. Why is it that, in a simple script I can use:
-
- $* = 1;
- $/ = undef;
- while (<>) {
- /(.|\n)*/ && print $&;
- }
-
- ...and get paragraph output, but when using chat2.pl:
-
- $* = 1;
- $/ = undef;
- &chat'expect($handle, $secs, '(.|\n)*', '"$&"');
-
- ...I don't? In fact, I get nothing, even when there is
- stuff available for reading. I find that I have to use something
- like this:
-
- while ((&chat'select($timeout, $handle))[0] eq $handle) {
- print &chat'expect($handle, $secs, '(.*)\n', '"$1\n"');
- }
-
- ...and build up the output line by line. Why is this?
- The version of the library is: V2.01.alpha.7 91/06/16, if it makes
- a difference.
-
- Thanks in advance. Any assistance or suggestion is
- appreciated, as are appropriate FM references. :-)
-
- --
- Tres Hofmeister
- tres@ncar.ucar.edu
-