Abhijit Mahabal writes: > > On Tue, 14 Sep 2004, Austin Hastings wrote: > > > I was thinking about removing files this morning, and realized that I > > wish rm supported inclusion/exclusion. > > > > In particular, I wanted to remove "* but not Makefile" (since my > > Makefile uses lwp-download to re-fetch the source code, etc.) > > > > It occurred to me to wonder: can P6's c<but> do the same thing? > > > > That is, can I say: > > > > $my_rex = qr/fo*/ but not 'foo'; > > > > while (<>) { > > unlink if /$my_rex/; > > } > > The word "junction" came to my mind as I read your mail. > > $my_rex = qr/fo*/ & qr:not/foo/;
Judging from this, maybe we ought to have :not. Anyway, it's still possible: $my_rex = rx/fo*/ & none(rx/^foo$/); Luke