10 my $data < io($fname);
19 sub with_class_block (&) {
21 $_ =~ s{^class\s*(.*?)which\s*{(.*?)^};}
23 local *_ = { header => $1, body => $2 };
30 $h =~ s/^\s*\S+\s+// || die;
32 while ($h =~ /is\s*(\S+?),?/g) {
39 my $base = join(', ', parse_header);
40 ($base ? "extends ${base};\n\n" : '');
43 sub sq { # short for 'strip quotes'
45 $copy =~ s/^'(.*)'$/$1/;
46 $copy =~ s/^"(.*)"$/$1/;
53 s/implements *(\S+).*?{/"sub ${\sq $1} {"/ge;
58 sub top { "use namespace::clean -except => [ qw(meta) ];\n" }
59 sub tail { "__PACKAGE__->meta->make_immutable;\n"; }
61 for ("lib/Reaction/InterfaceModel/Object.pm", "lib/Reaction/InterfaceModel/Action/DBIC/Result.pm") {
64 return top.build_extends.filtered_body.tail;