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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
  3. From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
  4. Subject: Re: programming challenge
  5. Message-ID: <mcook.724441713@fendahl.dev.cdx.mot.com>
  6. Sender: news@merlin.dev.cdx.mot.com (USENET News System)
  7. Nntp-Posting-Host: fendahl.dev.cdx.mot.com
  8. Organization: Motorola Codex, Canton, Massachusetts
  9. References: <1992Dec12.100131.11703@zooid.guild.org> <1992Dec14.114044.22303@cs.ruu.nl>     <1992Dec14.185822.7058@wdl.loral.com> <1992Dec15.070653.7276@zooid.guild.org>
  10. Date: Tue, 15 Dec 1992 17:48:33 GMT
  11. Lines: 21
  12.  
  13. Mike Stramba <stramba@zooid.guild.org> writes:
  14.  
  15. >What I was puzzling over tonight was whether there was a single line 's/'
  16. >command syntax to delete all '_' characters but not '$_'.
  17.  
  18. But not '$_'?
  19.  
  20. >I did it with two lines:
  21.  
  22. >  s/( )_/$1/g;             # change ' _'  to ' '
  23. >  
  24. >  s/(\w)_/$1/g;            # change '\w_' to '\w'
  25.  
  26. s/\b_//g;
  27.  
  28. >There probably wouldn't be any advantage to having it in one line ???
  29.  
  30. If you can say what you mean in one sentence, and you use 10 sentences
  31. instead, you've just distracted your listener for 9 sentences.
  32.  
  33. Michael.
  34.