home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5639 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  799 b 

  1. Path: sparky!uunet!utcsri!eecg.toronto.edu!zq
  2. Newsgroups: comp.lang.perl
  3. From: zq@eecg.toronto.edu (Qing Zheng)
  4. Subject: Problem with pipe
  5. Message-ID: <1992Aug31.182643.12963@jarvis.csri.toronto.edu>
  6. Date: 31 Aug 92 22:26:43 GMT
  7. Lines: 27
  8.  
  9. #! /local/bin/perl
  10. #
  11. #    This is my own lpr command mylpr
  12. #
  13. #doing something that I want.
  14. .....
  15. # execute the real lpr
  16. exec '/usr/ucb/lpr', @ARGV;
  17.  
  18. If I issue the following command
  19.  
  20.     %mylpr file
  21.  
  22. everthing is ok. However, when I issue
  23.  
  24.     %cat file |mylpr
  25.  
  26. the print out is not correct. I guess the problem is that the pipe is not
  27. properly passed over to the "exec '/usr/ucb/lpr', @ARGV" since some lines of
  28. the initial part of the file is missing. Any idea on how to solve this problem?
  29.  
  30.   Thanks in advance.
  31.  
  32.   Please send mail to zq@eecg.toronto.edu
  33.  
  34. ---Qing
  35.  
  36.