WWW/Scraper/Opcode/REWRITE.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 20 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
scrape
2.0
BEGIN
2.0
CRAP 2.0
1  
2 use strict;
3  
4 package WWW::Scraper::Opcode::REWRITE;
5 use base qw(WWW::Scraper::Opcode);
6  
7 sub new { bless {'fieldsDiscovered' => []} }
8  
9 sub scrape {
10 my ($self, $scraper, $scaffold, $TidyXML, $hit) = @_;
11
12 my $sub_string = ${$TidyXML->asString};
13 my ($rg1,$rg2) = ($$scaffold[1],$$scaffold[2]);
14
15 $sub_string =~ s{$rg1}{$rg2}gsi;
16  
17 return ($self->_next_scaffold($scaffold), $sub_string, $attributes);
18 }
19  
20  
21 1;