【问题标题】:Using perl_set in nginx with perl module在 nginx 中使用 perl_set 和 perl 模块
【发布时间】:2013-12-21 13:25:50
【问题描述】:

在 nginx 配置文件中有这个:

http {
    perl_modules perl/lib;
    perl_require utiles.pm;
    perl_set $user_perfil utiles::get_perfil;
}

如果我在 html 页面中使用 ssi 变量“user_perfil”,如下所示:

<!--# echo var="user_perfil" -->

每次我这样做时,nginx 都会调用函数 'utiles::get_perfil' ?还是第一次?

【问题讨论】:

    标签: html perl http nginx perl-module


    【解决方案1】:

    该函数将在每次使用变量时运行;

    【讨论】:

    • 即使在同一页面中有多个调用?
    • 不,如果变量使用了两次或更多次,它只会第一次调用该函数;
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-06
    • 2012-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多