$ cat scrub.pl
#!/usr/bin/perl
use warnings;
use strict;
use XREL;
my $scrubber = XREL->new( allow => [ qw[ a p b i u hr br ] ] );
$scrubber->rules(
a => {
href => 1,
rel => qr/^nofollow$/i,
'*' => 0,
}
);
my $html = q[link ];
print $scrubber->scrub($html), $/;
$html = q[link ];
print $scrubber->scrub($html), $/;
$html = q[link ];
print $scrubber->scrub($html), $/;
$html = q[link ];
print $scrubber->scrub($html), $/;
__END__
output:
link
link
link
link