home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5857 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.2 KB  |  30 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!nstn.ns.ca!dragon.acadiau.ca!merlin!peter
  3. From: peter@merlin.acadiau.ca (Peter Steele)
  4. Subject: Re: What's the difference between `command` and system('command')?
  5. Message-ID: <peter.716216984@merlin>
  6. Sender: news@dragon.acadiau.ca
  7. Nntp-Posting-Host: merlin
  8. Organization: Acadia University
  9. References: <sasswb.716131013@k2> <1992Sep10.183530.21405@news.eng.convex.com>
  10. Date: Fri, 11 Sep 1992 13:09:44 GMT
  11. Lines: 17
  12.  
  13. >:What the difference between saying `some Unix command` and
  14. >:system('some Unix command')?  Are they synonymous?  Are there situations
  15. >:where one is better than the other?
  16.  
  17. >    `cmd`;
  18. >    $line = `cmd`;
  19. >    @lines = `cmd`;
  20.  
  21. >returns the output, as it does in the shell.  The first form,
  22. >however, throws it away.  system() works much (although not
  23. >quite exactly) as it does in C.
  24.  
  25. Where does error output go (i.e., stderr)? I have an application
  26. where I want to capture error output, not stdout.
  27. --
  28. Peter Steele        Unix Services Manager            peter.steele@acadiau.ca 
  29. Acadia Univ., Wolfville, NS, Canada B0P 1X0  902-542-2201  Fax: 902-542-4364
  30.