--- Chat.pm Sat Oct 28 00:47:21 2000 +++ /home/joost/opt/pmchat/PerlMonks/Chat.pm Tue Jul 30 14:51:00 2002 @@ -58,7 +58,7 @@ # Get general chat messages if ($c=$self->getpage(CHAT_URL)) { $c=~s/[\r\n\t]//g; - my @msgs=($c=~/message\s+author="([^\"]+)"[^>]+>\s*(.*?)\s*<\/message>/g); + my @msgs=($c=~/]+author="([^\"]+)"[^>]+>\s*(.*?)\s*<\/message>/g); if (@msgs) { while (@msgs) { my ($author, $msg)=(shift(@msgs),shift(@msgs)); @@ -161,7 +161,7 @@ # Add the new lines to the cache unshift @$cache, @newcache; # Trim the cache to the last 50 lines. - splice(@$cache, CACHE_LIMIT); + splice(@$cache, CACHE_LIMIT) if @$cache > CACHE_LIMIT; # Return the lines that were just added to the cache return reverse @newcache; } --- Users.pm Mon Sep 4 22:44:10 2000 +++ /home/joost/opt/pmchat/PerlMonks/Users.pm Tue Jul 30 13:32:42 2002 @@ -63,7 +63,12 @@ my $self=shift; if ( (time() - $self->{cache_users_ts}) > USERS_REFRESH) { if (my $c=$self->getpage(USERS_URL)) { - my %users=($c=~/user\s+username="([^\"]+)"\s+user_id="(\d+)"/g); + my %users; + for ($c=~/]+>/g) { + my ($name) = /username="([^\"]+)"/; + my ($id) = /user_id="(\d+)"/; + $users{$name}=$id; + } $self->{cache_users}=\%users; $self->{cache_users_ts}=time(); }