#!/usr/bin/perl $| = 1; use strict; use warnings; use HTML::TreeBuilder; my $url = '/intern/proj'; # URL des ausgewählten Menüeintrags, bzw. geladene Webseite my $tree = HTML::TreeBuilder->new; # empty tree $tree->implicit_tags(0); $tree->store_comments(1); $tree->parse_file(*DATA); foreach my $t ($tree->look_down( '_tag' , 'a' )) { if ($url eq $t->attr('href')) { my $s = HTML::Element->new('b', 'class' => 'selected'); $s->push_content($t->content_list); $t->replace_with( $s ); last; } } my $html = $tree->as_HTML; $html =~ s///g; $html =~ s/<\/html>//g; print $html; $tree->delete; 1; __DATA__