#!/pro/bin/perl use strict; use warnings; use LWP::Simple; use HTML::TreeBuilder; my ($from, $to) = @ARGV; my $route = get "http://www.netsoc.tcd.ie/~mu/cgi-bin/shortpath.cgi?from=$from&to=$to" or exit; my $tree = HTML::TreeBuilder->new; $tree->parse_content ($route); print $_->as_text, "\n" for $tree->look_down (_tag => qr{^(?:h[12]|a)$});