in reply to Re: time in mod_perl
in thread time in mod_perl

I'm looking through this scope response and the following Apache::Registry response. Both look very interesting and it's nice to have a suggestions to think about rather than just hitting my head on the wall some more.

My program is 20+ pages and most of it contains material I can not post. I took a few minutes to write a test program and I can not (yet) explain why my test program DOES WORK and my main code does not. Chances are, one of these two responses has the answer.

My small test code that DOES WORK is:
#!/usr/bin/perl # FILE: test_time_01.pl use warnings; use strict; use CGI qw(:standard escapeHTML); my $t = time; print start_multipart_form(-action => url()), p header(), start_html("test"), p ("The value of time is $t. <br><br>"), end_form();

Thank you,
Bruce

Edit: g0n - code tags

Replies are listed 'Best First'.
Re^3: time in mod_perl
by jettero (Monsignor) on Mar 27, 2007 at 19:24 UTC
    Right, it's like ikegami says then. That my $t = time isn't really in the global scope like you'd imagine. It's wrapped in a function ref that's stored in the handler (or something close to that).

    -Paul

Re^3: time in mod_perl
by Bruce32903 (Scribe) on Mar 27, 2007 at 19:51 UTC
    Thank you to everyone.

    When I pass my time variables to the subroutines it seems to work. Thus, it is a scope issue. I still don't know if there is a deeper wisdom here that I should be seeking or if I should just pass all variables with mod_perl and move on. Either way, I am back on track for this project.

    Thank you,
    Bruce