You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Enrico Sorcinelli <e....@pisa.iol.it> on 2004/02/24 18:02:04 UTC

[RFC] Apache::Syntax::Highligh::Perl

Hi all,

I've just packaged an old project.

Apache::Syntax::Highlight::Perl is a simple mod_perl (both 1 and 2) module that
provides syntax highlighting for Perl code. This module is a wrapper around
Syntax::Highlight::Perl.

You can see a preview at:

	http://modperl.it/highlight/

(currently, only filenames matching \.(p|P)(l|L|m|M)$ 'FileMatch' regex are
processed)

Optionally you can download plain file by adding 'download' param in the query 
string. For example:

	http://modperl.it/highlight/lib/Apache/Syntax/Highlight/Perl.pm?download

I plan to put it on CPAN and eventually add a cache layer for processed (and
unchanged) files, so any comment about namespace and/or criticism are welcome :-)

by

	- Enrico

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [RFC] Apache::Syntax::Highligh::Perl

Posted by Enrico Sorcinelli <e....@pisa.iol.it>.
On Tue, 24 Feb 2004 09:22:52 -0800
Stas Bekman <st...@stason.org> wrote:

Hi Stas, 

> The original module has already a pretty long name. 
> Apache::Syntax::Highlight::Perl makes it even longer, but it's only used from 
> httpd.conf (i.e. no need to type it too often) so I suppose that's OK.

Yes

> Otherwise Apache::PerlSyntaxHighlight or Apache::SyntaxHighlightPerl is a 
> better choice, IMHO, since it uses less namespaces [...]

There aren't conventions about naming of mod_perl wrappers around existant
modules, so I simply added the original namespace to 'Apache::'

Maybe can we suggest to apply s/:// to original namespace, when applicable
(i.e. for modules one-shot without sub classes)...?

Thanks for suggestions :-)

by

	- Enrico

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [RFC] Apache::Syntax::Highligh::Perl

Posted by Stas Bekman <st...@stason.org>.
Enrico Sorcinelli wrote:
> Hi all,
> 
> I've just packaged an old project.
> 
> Apache::Syntax::Highlight::Perl is a simple mod_perl (both 1 and 2) module that
> provides syntax highlighting for Perl code. This module is a wrapper around
> Syntax::Highlight::Perl.

The original module has already a pretty long name. 
Apache::Syntax::Highlight::Perl makes it even longer, but it's only used from 
httpd.conf (i.e. no need to type it too often) so I suppose that's OK.

Otherwise Apache::PerlSyntaxHighlight or Apache::SyntaxHighlightPerl is a 
better choice, IMHO, since it uses less namespaces. The more namespaces you 
have the more memory is consumed and slower the lookups of subs and package 
vars are, since it has to traverse more chains. Granted separately these are 
all minor things, but many of those together can count for a significant overhead.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html