in reply to Better Way of Manipulating Array Elements
"Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions made. Otherwise it returns false (specifically, the empty string)."
Did you notice that you also manipulated @a by the way?
"Note that $_ is an alias to the list value" (from map)
...so @a holds the list you wanted 8 )
Cheers Rolf
UPDATE: I'd rather preferre something like this map { /(d)/ ? "new($1)" : $_ } @a
|
|---|