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