%INIT> use LWP::Simple; my $maxcount = 5; my $referer = $r->header_in( 'Referer' ); my ($www,$tld) = $referer =~ /(www\.)?perlmonks\.(\w+)/i; $tld ||= 'org'; my ($count,$title,$author,$node,$html); while ($title eq $author) { last if $count++ >= $maxcount; $html = get("http://perlmonks.com/index.pl?op=randomnode"); ($node) = $html =~ /\blastnode_id=(\d+)/; ($title) = $html =~ /