in reply to perl rules
s/\s+//g is preferrable over s/\s//g. It allows the substitution to do as much work in each match as possible. Single \s makes it stop more often than necessary.