#!/usr/bin/perl use strict; use warnings; use feature qw/ say /; use Data::Dumper; use WWW::Mechanize; use WWW::Mechanize::TreeBuilder; my $mech = WWW::Mechanize->new(); WWW::Mechanize::TreeBuilder->meta->apply($mech); $mech->get("http://millercenter.org/president/clinton/oralhistory/roger-altman"); for ( $mech->look_down(_tag => 'p') ) { next unless $_->as_trimmed_text =~ m/a haircut in California/; say $_->as_HTML; } __END__ ####

The election occurred and about a week later Reagan was getting a haircut in California and he came out of the barbershop. There had been some minor event that day and he was asked what he thought of the latest developments in Iran and he said, I don’t talk about barbarians.