Re: Check POP3 E-mail

From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 11/05/04


Date: Fri, 05 Nov 2004 16:19:22 +0100

krakle wrote:
> "A. Sinan Unur" wrote:
>> krakle@visto.com (krakle) wrote:
>>>
>>> How about for resetting purposes in mod_perl?
>>
>> Care to show what you mean by giving us some code?
>>
>> Please note that I have a pretty good idea what you might be
>> referring to, but it is your job to actually _make_ an argument
>> (using code, since this is a programming newsgroup) for the point
>> you are trying to make.
>
> Since you insist on seeing code for whatever unknown reason before
> you answer my question (ignorance). I'll show you some...
>
> _WITHOUT resetting variable_
>
> use CGI;
> my $cgi = new CGI;
>
> my @message;
>
> if (some_other_yada) {
> push (@message, "This is message #1: $cgi->param('msg1')");
> }
>
> if (some_other_yada) {
> push (@message, "Now this is message 2: $cgi->param('msg2')");
> }
>
> if (@message) {
> foreach (@message) { print "$_\n" }
> } else {
> print "No messages";
> }

Did you run that code? Apparently not, since it doesn't even compile
(under strict). Consequently, it does not serve the purpose of
illustrating anything.

> If ran as a CGI everything works fine... HOWEVER, if ran as mod_perl
> @message retains the previous users data then the new users data adds
> to the array then the next users data will retain the last 2 users
> and so on... So Even if the current users session never had any
> "messages" to add @message will not be empty. BUT if you used
>
> my @message = ();
>
> just like the original poster used the array woudl be reset at the
> start of the script emptying any data left over from the previous
> session.

As I explained in another message in this thread, your theory is
incorrect, and if you had written real code and run it, you'd have found
out for yourself.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl