home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!robcad!calisto!ronys
- From: ronys@calisto.robcad.uunet (Rony Shapiro)
- Subject: class negation broken - OR - what am I doing wrong ?
- Message-ID: <1992Sep9.134920.2169@robcad.uucp>
- Followup-To: comp.lang.perl
- Sender: ronys@calisto (Rony Shapiro)
- Organization: Robcad Technologies ( 1980 ) Ltd, Israel
- Date: Wed, 9 Sep 1992 13:49:20 GMT
- Lines: 38
-
- Hello,
-
- Given a file which contains all 26 letters, one character per line, i.e.
- a
- b
- c
- .
- .
- .
- z
-
- I'd expect the following perl one-liner to print all characters except 'f':
-
- perl -n -e 'print if /[^f]/' file
-
- However, ALL of the characters are printed.
-
- As a check,
- perl -n -e 'print unless /[f]/' file
- works as expected on the same data.
-
-
- Is the problem with perl or my understanding of [^f] ?
-
- Platform: Sparc IPC running SunOS 4.1.2
- Perl compiled with cc.
-
- perl -v
-
- This is perl, version 4.0
-
- $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
- Patch level: 35
-
- --
- Rony Shapiro
-
- ronys%robcad@uunet.uu.net OR uunet!robcad!ronys
-