From: Frank Lichtenheld Date: Sat, 4 Feb 2006 00:12:06 +0000 (+0000) Subject: Forgot to commit some new files related to the mod_perl changes X-Git-Tag: switch-to-templates~177 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=9c048903c83d44428f638e77df45daaf076362c6;p=deb%2Fpackages.git Forgot to commit some new files related to the mod_perl changes --- diff --git a/bin/mod_perl-startup b/bin/mod_perl-startup new file mode 100644 index 0000000..47d4b5d --- /dev/null +++ b/bin/mod_perl-startup @@ -0,0 +1,5 @@ +#!/usr/bin/perl + +use lib "/org/packages.debian.org/lib"; + +1; diff --git a/lib/Packages/CGI.pm b/lib/Packages/CGI.pm new file mode 100644 index 0000000..e9d834c --- /dev/null +++ b/lib/Packages/CGI.pm @@ -0,0 +1,64 @@ +package Packages::CGI; + +use Exporter; +our @ISA = qw( Exporter ); +our @EXPORT = qw( fatal_error error hint debug msg + print_errors print_hints print_debug print_msgs ); + +our $debug = 0; + +our (@fatal_errors, @errors, @debug, @msgs, @hints); + +sub reset { + @fatal_errors = @errors = @debug = @msgs = @hints = (); +} + +sub fatal_error { + push @fatal_errors, $_[0]; +} +sub error { + push @errors, $_[0]; +} +sub hint { + push @hints, $_[0]; +} +sub debug { + my $lvl = $_[1] || 0; + push(@debug, $_[0]) if $debug > $lvl; +} +sub msg { + push @msgs, $_[0]; +} +sub print_errors { + return unless @fatal_errors || @errors; + print '
'; + foreach ((@fatal_errors, @errors)) { + print "

ERROR: $_

"; + } + print '
'; +} +sub print_debug { + return unless $debug && @debug; + print '
'; + print '

Debugging:

';
+    foreach (@debug) {
+	print "$_\n";
+    }
+    print '
'; + +} +sub print_hints { + return unless @hints; + print '
'; + foreach (@hints) { + print "

$_

"; + } + print '
'; +} +sub print_msgs { + foreach (@msgs) { + print "

$_

"; + } +} + +1;