Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 33cec28f85128f3ac1d12ea340e5eaf3 > files > 152

perl-Syntax-Highlight-Engine-Kate-0.80.0-2.mga4.x86_64.rpm

#!/usr/bin/perl 
use strict;
use warnings FATAL => 'all';

use Data::Dumper;
use File::Slurp qw(slurp);
use Syntax::Highlight::Engine::Kate::All;
use Syntax::Highlight::Engine::Kate;

my $kate = Syntax::Highlight::Engine::Kate->new(
	language => 'Perl',
);

my $text = slurp(shift);
my @hl = $kate->highlight($text);
print "==\n";
#print Dumper \@hl;
while (@hl) {
	my $string = shift @hl;
	my $type = shift @hl;
	$type ||= 'Normal';
	print "'$string'    '$type'\n";

}