update on my reply
@temp = map { $_ =~ s/cats/dogs/g; $_ } @temp;
I think that what is happening is that, if a substitution occurs, the $Count value for the number of substitutions gets placed into @temp. Otherwise, a null value gets inserted. And for some reason, the original array gets the replacement changes.
My solution was to make a copy of the original array and a third copy to receive the $Count values....
User Profile
Collapse
-
@temp = map { $_ =~ s/cats/dogs/g; $_ } @temp;
I think that what is happening is that, if a replacement occurs, the value '1' gets placed into @Temp. Otherwise, a null value gets inserted. And for some reason, the original array gets the replacement changes.
RomanoLeave a comment:
No activity results to display
Show More
Leave a comment: