home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4971 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.0 KB  |  36 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!math.fu-berlin.de!Sirius.dfn.de!chx400!bernina!neptune!weingart
  3. From: weingart@inf.ethz.ch (Tobias Weingartner)
  4. Subject: open - Does it use the shell?
  5. Message-ID: <1992Jul27.100134.20233@neptune.inf.ethz.ch>
  6. Followup-To: comp.lang.perl
  7. Keywords: open, shell
  8. Sender: news@neptune.inf.ethz.ch (Mr News)
  9. Nntp-Posting-Host: tau.inf.ethz.ch
  10. Reply-To: weingart@inf.ethz.ch
  11. Organization: ETH - Switzerland
  12. Date: Mon, 27 Jul 1992 10:01:34 GMT
  13. Lines: 21
  14.  
  15. Yo, perl dudes and dudettes!
  16.  
  17. I have a small perl script, which amounts to roughly:
  18.  
  19. $args = join(' ', @ARGV);
  20. $prog = './someperlprog';
  21. open(FOOBAR, "$prog $args -xxx -xxx |");
  22. chop( @DATA = <FOOBAR> );
  23. foreach $i (@DATA){
  24. ...
  25. }
  26.  
  27. Ok, the prob is this, the open seems to invoke the
  28. shell.  Yes, there are meta-chars in $args, but $prog
  29. exists.  Does open always invoke the shell on meta chars?
  30.  
  31. There has got to be a better way than to doubly escape,
  32. or quote everything.
  33.  
  34. --Toby.
  35.  
  36.