my $url=new URI::URL 'http://www.perlmonks.org/index.pl'; $url->query_form(op => "login",node_id => "15848",user => $pm_user,passwd => $pm_password,expires=> "+10y"); my $WWWRequest = new HTTP::Request 'GET', $url->as_string() ; my $WWWResult = $WWWAgent->request($WWWRequest); die "Error logging in $WWWResult->code $WWWResult->message" if(!$WWWResult->is_success); $parser->parse($cb_ticker); my $key = undef; sub hdl_start{ my ($p, $elt, %atts) = @_; if ($elt eq "message") { open(INBOX,">>/tmp/inbox.db") || die $!; my $time = $atts{time}; $time =~ s/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/$4\:$5\:$6 $3\/$2\/$1/; $key++; print INBOX "Time: ",$time," Message from: ",$atts{author}," Status: ",$atts{status},"\n"; close(INBOX); } } #Edit: Oops, pasted an older snippet sub hdl_end{ my ($p, $elt) = @_; } sub hdl_char { my ($p, $str) = @_; $str =~ s/^\n+//g; if ($key && $str) { $str =~ s/\[id\:\/\/(\d*?)\]/http\:\/\/www\.perlmonks\.com\/index\.pl\?node_id\=$1/g; print $str,"\n"; open(INBOX,">>/tmp/inbox.db") || die $!; print INBOX $str,"\n"; close(INBOX); } } sub hdl_def { }