Apache-XPP

 view release on metacpan or  search on metacpan

lib/Apache/XPP.pm  view on Meta::CPAN

$Apache::XPP::main_class = 'Apache::XPP';

=item C<$debug>

Activates debugging output.  All debugging output is sent to STDERR.

At present there are only 4 levels of debugging :
 0 - no debugging (default)
 1 - some debugging
 2 - verbose debugging
 3 - adds some Data::Dumper calls

=item C<$debuglines>

Optionally, you can activate the $debuglines, which will cause all
debugging output to include the line numbers (in this file) of the debugging.

=back

=cut

lib/Apache/XPP.pm  view on Meta::CPAN

=cut
sub parse {
	my $self			= shift;
	my $class			= ref($self) || return undef;
	my $string			= $self->source;
	warn "xpp: parsing source" . ($debuglines ? '' : "\n") if ($debug);

	my @codesrc;
	{
		if ($debug >= 3) {
			eval "use Data::Dumper;";
			local($Data::Dumper::Indent)	= 0;
		}
		warn "xpp: parsing source:\n<<\n$string\n>>" . ($debuglines ? '' : "\n") if ($debug);

#		The regex in the while() statement below is somewhat complex. It was placed in one line for efficiency,
#		but this is how it came to be:
#		my $re_b		= q{<\?(?:xpp)?(=)?((?:(?!<\?|\?>).)*};	# only q{} and not qr{} because there is an imbalanced paren matched in the next line
#		my $re_e		= q{(?:(?!\?>).)*)\?>};					# only q{} and not qr{} because there is an imbalanced paren matched in the previous line
#		my $double_xpp	= qr{${re_b}(?:${re_b}${re_e})?${re_e}}so;
#		my $regex		= qr(^((?:(?!<\?).)*)$double_xpp)s;

#		# this was the old xpp parsing regex (which didn't handle embedded tags).
#		while (($string =~ s/^(.*?)\<\?(?:xpp)?(=)?(.*?\s*)\?\>//so) || ($string =~ s/^(.+)$//so)) {
		while (($string =~ s/^((?:(?!<\?).)*)<\?(?:xpp)?(=)?((?:(?!<\?|\?>).)*(?:<\?(?:xpp)?(?:=)?(?:(?!<\?|\?>).)*(?:(?!\?>).)*\?>)?(?:(?!\?>).)*)\?>//so) || ($string =~ s/^(.+)$//so)) {
			my $text	= $1;
			my $print	= $2 ? 1 : 0;
			my $code	= $3;
			warn Data::Dumper->Dump([$text,$code], [qw(text code)]) if ($debug >= 3);
			
			$text =~ s#\\#\\\\#gso;
			$text =~ s#\'#\\\'#gso;
			
			if ($text) {
				if ($self->is_main() && !$self->r()->notes('headersaway')) {
					push(@codesrc, "\$xpp->r()->send_http_header();\n");
					$self->r()->notes(headersaway => 1);
				}
				my $textsrc	= 'print ' . join(qq{ . "\\n"\n\t. }, map { qq{'$_'} } (split(/\n/, $text,-1))) . ";";

lib/Apache/XPP.pm  view on Meta::CPAN


Revision 1.28  2002/01/16 22:06:46  kasei
- Updated README to mention version 2.01
- POD typo fix in XPP.pm

Revision 1.27  2002/01/16 21:06:01  kasei
Updated VERSION variables to 2.01

Revision 1.26  2002/01/16 21:00:02  kasei
- Added PREREQ_PM arguments to Makefile.PL
- XPP.pm now only uses Data::Dumper if $debug >= 3 (not listed as a prereq)

Revision 1.25  2000/09/23 01:22:06  dweimer
Fixed VHostIncludeDir's, thanks david.

Revision 1.24  2000/09/20 00:33:18  zhobson
Fixed a warning in docroot(), misplaced "-" made it look like an invalid range

Revision 1.23  2000/09/08 22:26:44  david
added, changed, revised, and otherwise cleaned up a lot of POD
cleaned up new()

lib/Apache/XPP/Cache/Store/File.pm  view on Meta::CPAN

Apache::XPP::Cache::Store
FileHandle
File::stat

=cut

use Carp;
use strict;
use File::stat;
use FileHandle;
use Data::Dumper;
use Apache::XPP::Cache::Store;
use vars qw( @ISA $debug $debuglines );

BEGIN {
	@ISA		= qw( Apache::XPP::Cache::Store );
	$Apache::XPP::Cache::Store::File::REVISION = (qw$Revision: 1.9 $)[-1];
	$Apache::XPP::Cache::Store::File::VERSION = '2.01';
	$debug		= undef;
	$debuglines	= 1;
}



( run in 0.517 second using v1.01-cache-2.11-cpan-4d50c553e7e )