in reply to Re: How to remove unwanted text from elements of an array?
in thread How to remove unwanted text from elements of an array?
# that didn't work: @array1 = map { s/INVITE:// } @array;
In the code above you collect results of s/// operator, i.e. number of successful substitutions, which is not what you want. You want the content of $_ after substitution. And thus, you have to do this instead:
... which indeed does work quiet nicely :)@array1 = map { s/INVITE://; $_ } @array;
BR
Update: expanded explanation about return value of s/// operator.
|
|---|