> From: Hardy Merrill [mailto:[EMAIL PROTECTED]]
> 
> You could do something like this - instead of using hash %uref,
> you could create a reference to an anonymous hash, and then use
> that reference to 1) refer to hash elements, *AND* 2) to pass
> to inc::db::GetUser - something like this:
> 

OR..., you could create a tied hash, e.g. %Users, which fetches
the user data (like in the GetUsers function) if it doesn't already exist,
and it can all work transparently to the caller:

# Assuming your package is 'Tie::Hash::GetUsers'
tie my %users, 'Tie::Hash::GetUsers';
....
$user_href = $users{$id};

Reply via email to