[Chicago-talk] map and pop

Andy Lester andy at petdance.com
Mon Dec 29 15:34:11 CST 2003


On Mon, Dec 29, 2003 at 01:31:28PM -0800, Dooley, Michael (Dooley.Michael at con-way.com) wrote:
> my @nfiles=grep /^car/, @files;

If you want to just have a version of the list without that element in
it, then

my @nfiles = grep !/^car/, @files;

If you want both a copy of the removed one, AND you want it removed,
then you'll need a more explicit loop, unless you want to get really
tricky.

xoa

-- 
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance



More information about the Chicago-talk mailing list