Perl method to remove unquoted spaces from strings