# Squeeze whitespace tr/\n\r\f\t //s # Then # This: s/^\s|\s$//g; # Or this: s/^\s//; s/\s$//;