Syntax-Highlight-Universal
view release on metacpan or search on metacpan
Universal.pm view on Meta::CPAN
my $class = defined $region ? $region->name : 'unknown';
$class =~ s/\W/_/g;
return $class;
};
Note: this approach is not recommended and might stop working in future
versions of the module.
=head2 Text processing is very slow
Colorer was originally meant for desktop applications where one second to
load the configuration files doesn't matter. Unfortunately it matters a lot
for web applications. Furthermore, the parsing of text itself also needs
some time though much less than processing HRC configuration.
I<Solution 1>: If you often have to highlight the same texts, you
can use caching. L<Set up caching directory|/Setting a cache directory> where
the module can store processed text. Next time the same text needs to be
highlighted the result will be taken from the cache instead of parsing the
text all over again (and loading the necessary configuration files in the
process).
( run in 0.435 second using v1.01-cache-2.11-cpan-299005ec8e3 )