[Chicago-talk] map and pop

Dooley, Michael Dooley.Michael at con-way.com
Tue Dec 30 08:12:39 CST 2003

as I was driving home last night (before I saw your post) it came to me to
do exactly that.

-----Original Message-----
From: chicago-talk-bounces at mail.pm.org
[mailto:chicago-talk-bounces at mail.pm.org] On Behalf Of Brian Katzung
Sent: Monday, December 29, 2003 5:36 PM
To: Chicago.pm chatter
Subject: Re: [Chicago-talk] map and pop

Dooley, Michael wrote:
> I want to do something like this, but I also want to remove the found
> element from @files.
> my @nfiles=grep /^car/, @files;
> can anyone point me in the right direction, I am thinking map is needed
> I don't have much confidence using it.

Why not just:

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

Brian Katzung, President, Kappa Computer Solutions, LLC
Phone +1.877.367.8837 or visit http://www.kappacs.com/

Chicago-talk mailing list
Chicago-talk at mail.pm.org

More information about the Chicago-talk mailing list