Re: END block weird behavior

[prev] [thread] [next] [Date index for 2004/12/02]

From: Stas Bekman
Subject: Re: END block weird behavior
Date: 00:48 on 02 Dec 2004
Faisal Nasim wrote:
> Okay here's a demonstration:
> 
> The test script is:
> 
> #!/usr/local/bin/perl
> 
> use strict;
> use vars qw ($mydata);
> 
> $mydata = 'woodooeer';
> my $data = 'woodoo';
> my $data2 = 'dingdong';
> 
> print "Content-type: text/plain\n\n";
> 
> print scalar localtime () , "\n\n";
> print `cat /tmp/modperltest.txt`;
> 
> END
> {
>         open FILE , '>/tmp/modperltest.txt';
>         print FILE "DATA: " , scalar localtime , "\n";
>         print FILE "$data\n";
>         print FILE "$mydata\n";
>         print FILE "$data2\n";
>         close FILE;
> }
> 
> 
> You can see the different behaviors at:
> no modperl: http://www.nasim.org/test/short.cgi
> modperl: http://www.nasim.org/test/short.pl
> 
> Note that the file is printed first and then updated. Hit refresh
> to see that modperl misses $mydata.

Actually it's very inconsistent. If I hit reload I get the value of 
$mydata appearing and disappearing in both scripts.

Any chance you could rewrite your code not to use the END block for the 
desired functionality? At least until we get some freed resources to work 
on modperl1 issues again?

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

END block weird behavior
Faisal Nasim 20:12 on 26 Nov 2004

Re: END block weird behavior
Faisal Nasim 10:34 on 30 Nov 2004

Re: END block weird behavior
Stas Bekman 00:48 on 02 Dec 2004

Re: END block weird behavior
Faisal Nasim 07:53 on 02 Dec 2004

Re: END block weird behavior
Stas Bekman 15:29 on 02 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52