CGI-Ex
view release on metacpan or search on metacpan
lib/CGI/Ex/Conf.pm view on Meta::CPAN
### I left it as a general use for other types
### is specified
sub read_handler_html {
my $file = shift;
my $args = shift;
if (! eval { require YAML }) {
my $err = $@;
my $found = 0;
my $i = 0;
while (my($pkg, $file, $line, $sub) = caller($i++)) {
return undef if $sub =~ /\bpreload_files$/;
}
die $err;
}
### get the html
local *IN;
open (IN, $file) || return undef;
CORE::read(IN, my $html, -s $file);
close IN;
lib/CGI/Ex/Die.pm view on Meta::CPAN
sub die_handler {
my $err = shift;
die $err if $no_recurse;
local $no_recurse = 1;
### test for eval - if eval - propogate it up
if (! $IGNORE_EVAL) {
if (! $ENV{MOD_PERL}) {
my $n = 0;
while (my $sub = (caller(++$n))[3]) {
next if $sub !~ /eval/;
die $err; # die and let the eval catch it
}
### test for eval in a mod_perl environment
} else {
my $n = 0;
my $found = 0;
while (my $sub = (caller(++$n))[3]) {
$found = $n if ! $found && $sub =~ /eval/;
last if $sub =~ /^(Apache|ModPerl)::(PerlRun|Registry)/;
}
if ($found && $n - 1 != $found) {
die $err;
}
}
}
### decode the message
lib/CGI/Ex/Dump.pm view on Meta::CPAN
}
###----------------------------------------------------------------###
### same as dumper but with more descriptive output and auto-formatting
### for cgi output
sub _what_is_this {
return if ! $ON;
### figure out which sub we called
my ($pkg, $file, $line_n, $called) = caller(1 + ($CALL_LEVEL || 0));
substr($called, 0, length(__PACKAGE__) + 2, '');
### get the actual line
my $line = '';
if (open(IN,$file)) {
$line = <IN> for 1 .. $line_n;
close IN;
}
### get rid of extended filename
( run in 0.504 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )