Not necessarily prettier:

@new = map {m/(.*)(?:jpg|gif)$/i?"$1html":$_ } @old;




Karl Kaufman wrote:

>I, too, am interested in this syntax.  I had to do the same juggling in order to 
>"map" the values without affecting the original array -- and would prefer cleaner 
>syntax if it's possible.  Thx!  Karl
>
>>@new_names = map { ($x = $_) =~ s/(jpg|gif)$/html/i; $x } @old_names;
>>
>>Is there a more elegant way to accomplish this? It just doesn't seem 
>>elegant assigning $_ to $x, performing the substitution on $x, and then 
>>returning $x.
>>
>
>




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

Reply via email to