in reply to How to remove unwanted text from elements of an array?

This is such a simple question that I have to ask, are you serious about learning Perl, or do you just want the answer to turn in so you get a pass in your class?

If it were me, and I were in your position, I would pull out the documentation for split and map, or split and perlsyn, which discusses foreach loops. The foreach method would probably require push also.

Here's a map solution. I sincerely hope that I'm not giving you a homework answer.

my @array = qw/INVITE:Contact INVITE:To INVITE:From/; my @new_array = map { ( split /:/ )[1] } @array;

Dave