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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: class negation broken - OR - what am I doing wrong ?
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Sep10.001625.17567@news.eng.convex.com>
  8. Date: Thu, 10 Sep 1992 00:16:25 GMT
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. References: <1992Sep9.134920.2169@robcad.uucp>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 18
  17.  
  18. From the keyboard of ronys@calisto.robcad.uunet (Rony Shapiro):
  19. :I'd expect the following perl one-liner to print all characters except 'f':
  20. :
  21. :    perl -n -e 'print if /[^f]/' file
  22. :
  23. :However, ALL of the characters are printed.
  24.  
  25. Right -- your lines have two characters, one of which
  26. is a newline, which your [^f] matched.
  27.  
  28. Add -l for auto chop and appending of \n.
  29.  
  30. --tom
  31. -- 
  32.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  33. But you have to allow a little for the desire to evangelize when you
  34. think you have good news.  
  35.         --Larry Wall in <1992Aug26.184221.29627@netlabs.com>
  36.