sub trim { my @args = ( @_ ) ? @_ : $_; for ( @args ) { s/\A\s+//; s/\s+\z//; } return wantarray ? @args : $args[0]; }