# WRONG @new_list_wrong = map{ s/that idiot/our esteemed leader/ } @list; #### @new_list_right = map{ s/that idiot/our esteemed leader/; $_ } @list; #### # yet another way to strip leading and trailing whitespace: @cleaned_list = map{ m/^\s*?(\w.*?)\s*?$/ } @list;