Apache-JAF
view release on metacpan or search on metacpan
lib/Apache/JAF.pm view on Meta::CPAN
# {page} key in result hash equals to current handler
$self->{res}{page} = $self->{handler};
return $self
}
# Load handlers and temlates during compile-time...
################################################################################
sub import {
my ($package, %args) = @_;
$package = (caller())[0];
load_handlers(undef, $package, $args{handlers}) if $args{handlers};
load_templates(undef, $package, $args{templates}) if $args{templates};
}
# Load handlers
################################################################################
our (%HANDLERS, $PACKAGE);
sub _process_as_handler {
return unless /\.pm$/;
package JAF;
use strict;
our %IMPORTED = ();
sub import {
my $cl = 0;
my ($filename, $sub);
do {
($filename, $sub) = (caller($cl))[1,3];
$cl++;
} while ( $filename && $sub ne '(eval)');
if ($filename) {
return if exists $IMPORTED{$filename};
$filename =~ s/\.pm$/\//;
use DirHandle;
if (my $dh = DirHandle->new( $filename )) {
foreach my $file ($dh->read) {
next if $file !~ /\.pm$/;
( run in 0.372 second using v1.01-cache-2.11-cpan-b61123c0432 )