sub new { my $proto = shift(@_); my $userId=shift(@_); my $class = ref($proto) || $proto; my $self = { "user_id"=> undef, "user_name" => undef }; bless ($self, $class); my $href = GETSQL("SELECT user_name FROM users WHERE user_id = $userId"); @{$self}{keys %{$href}} = values %{$href}; return $self;