in reply to Grep is changing the original list?
grep won't stop you from modifying the arguments in the BLOCK. The path to wisdom lies in the realization that = is the assignment operator ...
That issue aside, if what you want are the members of @a that *lack* extensions, you should match things that don't end in a . followed by some word characters (something like that, anyhow). So try:
my @b = grep { !/\.\w+$/} @a;
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|