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/; (I don't think that :not is the option to negate, but there must be some syntax that works) I am not saying this is a better way to do it, but just another way that seems to do the same thing in the same way. > In general, what needs to be done to support this 'but, used as part of > a boolean'? --abhijit