Skip to content

Instantly share code, notes, and snippets.

@oetiker
Created May 11, 2011 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oetiker/966382 to your computer and use it in GitHub Desktop.
Save oetiker/966382 to your computer and use it in GitHub Desktop.
replace all href attribute values with http://xxx/x.x
my $dom = $res->dom('a[href]')->each(
sub { shift->attrs('href' => 'http://xxx/x.x'); }
);
$res->body($dom->to_xml);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment