Help for this page

Select Code to Download


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