in reply to Trimming whitespaces methods

The best way is:

s/^\s+//, s/\s+$// for @array;