#!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; use HTML::TableExtract; use XML::XSH2; my $w = 'WWW::Mechanize'->new; $w->get('http://www.perlmonks.org/?node=Voting%2FExperience%20System'); my $te = 'HTML::TableExtract'->new( headers => [qw[ Level XP ]] ); $te->parse($w->content); my $table = ($te->tables)[0]->rows; package XML::XSH2::Map; our $string; package main; xsh << 'end.'; open {$ARGV[0]} ; $string = xsh:subst(normalize-space(//var[@name="levelchange"]), ';', "\n", 'g') ; end. $string =~ s/^[0-9]+-//gm; $string =~ s/^([0-9]+)(.*)/$1$2 $table->[$1-1][1]/gm; print $string;