home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!dxcern!dxcern!cons
- From: cons@mercury.cern.ch (Lionel Cons)
- Subject: Bug or feature ?
- Message-ID: <CONS.92Nov9103421@mercury.cern.ch>
- Sender: news@dxcern.cern.ch (USENET News System)
- Organization: CERN, European Research Center for Particle Physics
- Distribution: comp
- Date: Mon, 9 Nov 1992 09:34:21 GMT
- Lines: 21
-
- I want to read the first two bytes of STDIN and then exec another
- process that uses the remaining chars from STDIN. According to the man
- pages the following script should work (if STDIN does not have the
- close-on-exec flag set):
-
- #!/usr/local/bin/perl
- $c1 = getc(STDIN);
- $c2 = getc(STDIN);
- print "First chars: '$c1' and '$c2'\n";
- exec('/bin/wc', '-c');
-
- It does not work (wc reply is 0), why ?
- --
-
- Lionel Cons
-
- +------- CERN - European Laboratory for Particle Physics -------+
- | E-mail: cons@dxcern.cern.ch |
- | Earth-mail: CN/SW/WS, CERN, CH-1211 GENEVE 23, Switzerland |
- | Phone: +41 22 767 49 13 Fax: +41 22 767 71 55 |
- +---------------------------------------------------------------+
-