sub trim2 { return trim2 $_ if not @_; return map { s/^\s+//; s/\s+$//; $_ } my @c = @_ if defined wantarray; for ( @_ ) { s/^\s+//, s/\s+$// } }