Beagle

 view release on metacpan or  search on metacpan

lib/Beagle/Util.pm  view on Meta::CPAN

    @WEB_NAMES, $SEARCHED_WEB_NAMES, $WEB_ADMIN, @SYSTEM_ROOTS,
    $CURRENT_USER,
);

BEGIN {

# I got error: "Goto undefined subroutine &die" on windows strawberry 5.12.2
# &CORE::die doesn't help

    *CORE::GLOBAL::die = sub {
#        goto &die unless ( caller() )[0] =~ /^Beagle::/;
        return die @_ unless ( caller() )[0] =~ /^Beagle::/;

        @_ = map { encode( locale => $_ ) } @_;
        return confess @_ if enabled_devel();

        # we want to show user the line info if there is nothing to print
        push @_, newline() if @_;

        @_ = grep { defined } @_;
        die @_;
    };

    *CORE::GLOBAL::warn = sub {
# interesting, I get warn if use goto &warn:
# Goto undefined subroutine &Beagle::Util::warn
#       goto &warn unless (caller())[0] =~ /^Beagle::/;
        return warn @_ unless ( caller() )[0] =~ /^Beagle::/;

        @_ = grep { defined } @_;

        # we want to show user the line info if there is nothing to print
        push @_, newline() if @_;
        @_ = map { encode( locale => $_ ) } @_;
        warn @_;
    };
}

lib/Beagle/Web/Router/Util.pm  view on Meta::CPAN

            on_match => sub {
                return web_admin() ? 1 : 0;
            },
        }
    );
}

sub router_package {
    my $pkg;
    for my $i ( 1 .. 10 ) {
        my $p = ( caller($i) )[0];
        if ( $p && $p =~ /::Router$/ ) {
            $pkg = $p;
        }
    }
    return $pkg;
}

sub any {
    my $methods;
    $methods = shift if @_ == 3;



( run in 0.254 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )