home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6941 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.5 KB  |  40 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: Executing required files
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Nov11.145949.6745@news.eng.convex.com>
  8. Date: Wed, 11 Nov 1992 14:59:49 GMT
  9. Distribution: comp.lang.perl
  10. Reply-To: tchrist@convex.COM (Tom Christiansen)
  11. References: <1992Nov5.062131.17033@reed.edu>> <JGD.92Nov10153029@kodiak.acl.lanl.gov> <mcook.721447621@fendahl.dev.cdx.mot.com>
  12. Nntp-Posting-Host: pixel.convex.com
  13. Organization: Convex Computer Corporation, Colorado Springs, CO
  14. X-Disclaimer: This message was written by a user at CONVEX Computer
  15.               Corp. The opinions expressed are those of the user and
  16.               not necessarily those of CONVEX.
  17. Lines: 21
  18.  
  19. From the keyboard of mcook@fendahl.dev.cdx.mot.com (Michael Cook):
  20. :jgd@acl.lanl.gov (Jerry G. DeLapp) writes:
  21. :
  22. :>I still like the idea of __REQUIRED__ to armor plate me from idiots setting $0
  23. :>though. Any chance of this appearing in 5.0?
  24. :
  25. :What's wrong with setting $0?  At the risk of declaring myself an idiot, I do
  26. :this pretty-much as a matter of course: $0 =~ s%^.*/%%;
  27.  
  28. You lose your visible arguments to ps.  Better this way:
  29.  
  30.     $0 =~ s%^.*/%%;  # clobbered visible @ARGV
  31.     $0 .= " @ARGV";  # restore
  32.  
  33.  
  34. --tom
  35. -- 
  36.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  37.  
  38.     Some are born to perl, some achieve perl, and some have perl
  39.     thrust upon them.  
  40.