From the Parsewords documentation: The $keep argument is a boolean flag. If true, then the tokens are split on the specified delimiter, but all other characters (quotes, backslashes, etc.) are kept in the tokens. I think that means that your second argument to quotewords needs to be true to avoid the single quote.