>>>>> "Jeff" == Jeff 'Japhy' Pinyan <[EMAIL PROTECTED]> writes:

Jeff> On Jul 15, Jenda Krynicky said:
>>> (better question) is there a better way to achieve the same result?
>> 
>> my @crap = map{ s/\.\w+$//; $_ } glob( '*.pl *.pgp');

Jeff> I'm so funny.

Jeff>   my @crap = grep s/\.\w+$//, glob("*.pl *.pgp");

Ha ha.  I hate modifying $_ in a grep or map.  Here's a better one:

my @crap = map /(.*?)(?:\.\w+)?$/, glob("*.pl *.pgp");

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to