hmm. I may just be being difficult, having internal featuritis. I'd like to be able to trim arrayrefs and hashrefs at once, recursively, either in-place or making a deep copy, depending. But without causing trouble. Almost mentally healthy enough to delete this without sending. sub trim { if (wantarray){ my @ret = @_; trim(@ret) return @ret; }elsif (defined wantarray){ my $t = shift; trim($t); return $t; } # something about dealing with references here? s/\s*(.*?)\s*\z/$1/s for @_; } > What does this do? > > sub shortname { > my $self = shift; > return trim( $self->{fullname} ); > } > Causes problems. Should raise a warning or not even compile. Better written like so: sub shortname { my $self = shift; return my $dummy = trim( $self->{fullname} ); } or maybe sub shortname { my $self = shift; "@{[trim( $self->{fullname}]}"; } -- "Lay off that whiskey, and let that cocaine be!" -- Johnny CashThread Previous | Thread Next