You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Eric Kolve <er...@corp.classmates.com> on 2001/04/26 23:25:17 UTC
apache::registry + use strict curiosity
I found something a bit curious that I was wondering if someone could
explain. I have the following apache::registry script I called test.reg:
#!/usr/bin/perl
use strict;
if($test){
# do stuff
}
print qq|HTTP/1.1 200 OK\r\n|;
print "HELLO WORLD\n\n";
I ran my server in single-user mode (httpd -X) and requested the page
which causes an internal server error because I didn't declare '$test'.
I next commented out the three conditional lines:
#if($test){
# do stuff
#}
Then requested the page a second time, which executed just fine. I
uncommented those three lines and requested the page a third time, which
strangely enough actually works. Registry stats pages to see if they
change and recompiles pages I believe. So I am wondering why isn't an
exception raised on the third request about not declaring '$test'? Did
the first request put '$test' in the symbol table?
thanks,
--eric
Re: apache::registry + use strict curiosity
Posted by ne...@mediaone.net.
that's no apache::registry. that's perl
there are big guns here who can answer
your questions but it am not one of them.
On Thu, Apr 26, 2001 at 02:25:17PM -0700, Eric Kolve wrote:
> I found something a bit curious that I was wondering if someone could
> explain. I have the following apache::registry script I called test.reg:
>
> #!/usr/bin/perl
>
> use strict;
> if($test){
> # do stuff
> }
>
>
> print qq|HTTP/1.1 200 OK\r\n|;
> print "HELLO WORLD\n\n";
>
>
> I ran my server in single-user mode (httpd -X) and requested the page
> which causes an internal server error because I didn't declare '$test'.
> I next commented out the three conditional lines:
>
> #if($test){
> # do stuff
> #}
>
> Then requested the page a second time, which executed just fine. I
> uncommented those three lines and requested the page a third time, which
> strangely enough actually works. Registry stats pages to see if they
> change and recompiles pages I believe. So I am wondering why isn't an
> exception raised on the third request about not declaring '$test'? Did
> the first request put '$test' in the symbol table?
>
> thanks,
>
> --eric
Re: apache::registry + use strict curiosity
Posted by Ken Williams <ke...@forum.swarthmore.edu>.
Yes, exactly. After the first run, $test got an entry in the symbol
table. Not usually an issue in CGI perl. =)
eric@corp.classmates.com (Eric Kolve) wrote:
>I found something a bit curious that I was wondering if someone could
>explain. I have the following apache::registry script I called test.reg:
>
>#!/usr/bin/perl
>
>use strict;
>if($test){
># do stuff
>}
>
>
>print qq|HTTP/1.1 200 OK\r\n|;
>print "HELLO WORLD\n\n";
>
>
>I ran my server in single-user mode (httpd -X) and requested the page
>which causes an internal server error because I didn't declare '$test'.
>I next commented out the three conditional lines:
>
>#if($test){
># do stuff
>#}
>
>Then requested the page a second time, which executed just fine. I
>uncommented those three lines and requested the page a third time, which
>strangely enough actually works. Registry stats pages to see if they
>change and recompiles pages I believe. So I am wondering why isn't an
>exception raised on the third request about not declaring '$test'? Did
>the first request put '$test' in the symbol table?
------------------- -------------------
Ken Williams Last Bastion of Euclidity
ken@forum.swarthmore.edu The Math Forum