my bad... you are right... interesting... is this a special case where map
return $1 instead of 1?
or is it a special case where /(PATTERN)MOREPATTERN/ evaluates to $1 when
true? (but why then no null elements?... interesting..

> -----Original Message-----
> From: David Gray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 4:17 PM
> To: [EMAIL PROTECTED]; 'Beginners (E-mail)'
> Subject: RE: rewrite without using two functions?
> 
> 
> > 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?"
> > 
> > > > 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;
> 
> Those two lines were working exactly the same way when I 
> tested them...
> I'm on a Win2000 Pro box with ActivePerl 5.6.1
> 
> Are they not working the same way on your system?
> 
>  -dave
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

----------------------------------------------------------------------------
--------------------
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]

Reply via email to