开发者

Dumping mod_perlified variables--what's the local namespace?

I have a mod_perl script:

use strict;
use warnings FATAL => 'all';
use 5.010001;

my $face = 'ugly';

use Data::Dump qq(pp);
die pp($Mo开发者_运维百科dPerl::ROOT::ModPerl::Registry::C_3a_www_test_2epl::face);

It dies undef at C:/www/test.pl line 8.

I was expecting "ugly" at C:/www/test.pl line 8.

If instead I

die pp(%ModPerl::ROOT::ModPerl::Registry::C_3a_www_test_2epl::);

...after restarting the service to clear any cached variables, face is not even listed.

I could have sworn this code was working the last time I used it...I wrote a whole die hook around this way of naming local variables so that I could get at certain local variables to dump debug information.

What's the local namespace?


Only variables shared using our are accessible this way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜