> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> 
> @UserCache;   # Place to store data already seen

This is an array, not a hash, depending on your range of
id numbers, you might want:
my %UserCache; # BTW, Are you using 'strict'??

> sub GetUser
> {
>       my ($id, $user)=@_;     # record number and hash reference to
> populate
>       # Store the info from the DB for later
>       $UserCache[$id] = $user;
> 
>       return 1;
You're always returning 1?? Is this useful??
You don't want to return something like:

my $sth = $dbh->prepare_cached("select user from users where id = ?");
return scalar($UserCache{$id} ||= $dbh->selectrow_array($sth, undef, $id));

> }


HTH,
Douglas Wilson

Reply via email to