home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7534 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.7 KB  |  45 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.cerf.net!netlabs!lwall
  3. From: lwall@netlabs.com (Larry Wall)
  4. Subject: Re: Is this a perl bug?
  5. Message-ID: <1992Dec14.175649.22784@netlabs.com>
  6. Sender: news@netlabs.com
  7. Nntp-Posting-Host: scalpel.netlabs.com
  8. Organization: NetLabs, Inc.
  9. References: <9212111642.AA27958@brimstone.unipalm.co.uk> <1992Dec12.072651.653@netlabs.com> <mcook.724207619@fendahl.dev.cdx.mot.com>
  10. Date: Mon, 14 Dec 1992 17:56:49 GMT
  11. Lines: 32
  12.  
  13. In article <mcook.724207619@fendahl.dev.cdx.mot.com> mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
  14. : lwall@netlabs.com (Larry Wall) writes:
  15. : >Similarly, `cat $foo` turns into something like backtick('cat ' . $foo),
  16. : >though I haven't actually put in a keyword to access that function yet.
  17. : Cool.  Would we be able to do something like this: backtick('cat',$foo), which
  18. : would be analogous to system('cat',$foo) vs. system("cat $foo")?
  19.  
  20. At the moment the new internal functions like backtick(), uc(), and
  21. glob() are unary operators, but I'll think about it some.
  22.  
  23. : And how about having it so the file name in open() can be separated from the
  24. : directive characters: open(FH,">",$foo).  That way, it would still work even
  25. : if the file name had funny characters (such as leading/trailing whitespace).
  26.  
  27. There might be a 3-arg sysopen, if I get around to it.
  28.  
  29. : And open(FH,"|-",'cat',$foo) could be like open(FH,"|cat $foo"), except that
  30. : it would be done directly via exec, not via "sh -c".
  31.  
  32. I don't see the point, when
  33.  
  34.     open(FH, "|-") || exec 'cat', $foo;
  35.  
  36. does the same thing.  In fact, so does
  37.  
  38.     open(FH, "|cat $foo");
  39.  
  40. as long as $foo contains no shell metacharacters.
  41.  
  42. Larry
  43.