Hello, All:

I'm having a difficult time understanding the map function.

I've got an array of file names that all end in 'jpg' or 'gif'. I'd like 
to create a parallel array of file names that end in 'html'. I'm creating 
the array this way...

@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.

-- 
Eric P.
Sunnyvale, CA


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

Reply via email to