map returns the result of the last evaluated statement... @must would have ones and zeros... I want the $1 portion but only if it ends in '/*' there really isn't a speed issue... it's more a "can i make this line look sweeter?"
> -----Original Message----- > From: David Gray [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 4:05 PM > To: 'Beginners (E-mail)'; 'Nikola Janceski' > Subject: RE: rewrite without using two functions? > > > > is there a way to write this without using map AND grep AND > > without making > > it longer than it is? > > @must = map { m/(.*)\/\*/; $1 } grep m/\/\*/, @recomp; > > > > where @recomp = qw( stuff/stuff.c > > crap/* > > morestuff/* > > stuffy/stuff_stuff.c > > stuffy/suffering.c > > ); # and more of the similar > > Hmm. Have you tried: > > @must = map { /^(.*)\/\*$/ } @recomp; > > If so, is there a big speed loss when you remove the grep? > > Interested, > > -dave > > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]