1#!/usr/bin/env perl
2
3# use this script to regenerate the test data files in t/perl Add a new file
4# to t/perl/before and when you run this, a "highlighted" version will be
5# created in t/perl/highlighted directory
6
7use lib 't/lib';
8use strict;
9use warnings;
10use TestHighlight ':all';
11
12my $to_highlight = get_sample_perl_files();
13my $total        = keys %$to_highlight;
14my $current      = 0;
15
16while ( my ( $orig, $new ) = each %$to_highlight ) {
17    $current++;
18    print "Processing $current out of $total ($orig)\n";
19    my $highlighter = get_highlighter('Perl');
20    my $highlighted = $highlighter->highlightText( slurp($orig) );
21
22    open my $fh, '>', $new or die "Cannot open $new for writing: $!";
23    print $fh $highlighted;
24}
25