On Sun, 30 Sep 2001, Johan Kuuse wrote:

> Returning to the original problem, trying to store the password in memory,
> as a property (PARAMS) of the application object:
> Is there any workaround for this, using Perl programming?
> Using a SuperClass?
> Overriding the CGI::Application's new() method?
> Anything?

Johan,

It looks like your question and code are asking different questions. :)
There aren't really other methods of storing data in memory besides using
something like mod_perl because HTTP and CGI are stateless. When you come
back and invoke a script a second time, it can't remember the first. Below
in your code, it looks like you simply want to get data from the web form,
which is easy. A CGI query object is available through
$my_application->query(), although the trick is that you have to invoke
MyApplication->new() before you can access the query function. If you want
to live on the edge (that is, break the standard CGI::App way to do
things, you could create your own CGI.pm query object, and get the data
from it to pass in:

use CGI;
my $q = new CGI;
my $data = $q->param('pasword_from_form');

Perhaps a cleaner way to handle this would be to use
$self->query inside of your run modes that need the data to get at the CGI
query object.

...I hope all that made sense.

  -mark
>
> How to?:
> ***********************************
> use MyApplication;
> my $data='PASSWORD_FROM_FORM'; #How to???
> my $my_application = MyApplication->new(
>                               PARAMS => {
>                                'data' => $data,
>                       }
>       );
> ***********************************
>
> This works fine:
> ***********************************
> use MyApplication;
> my $data='CONSTANT';
> my $my_application = MyApplication->new(
>                               PARAMS => {
>                                'data' => $data,
>                       }
>       );
> ***********************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

http://mark.stosberg.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to