>
> I have several common SQL queries that a lot of run modes will share. I
> can't put it in the prerun or init because running these queries
> depends on
> other things like the user being authenticated first.

I would create another module to store the common SQL, ie, create a database
(DBI) API so you can reuse and test it independently of your UI.


> For example:
> I need to get a list of the url's the user has in the database,
> but I can't
> get this info until their username and password has been verified
> and their
> user_id is added to their session.
>
> So I call run mode 'login' which verifies their name / pass and gets their
> user_id.
>
> I tried creating a test like follows:
>
> sub shared_test {
> my $self = shift;
>
> my $test_var = "TESTING 123";
>
> $self->param("TESTING", $test_var);
>
> }
>
> I would assume this would update the $self->param("TESTING") with the
> correct info.
>
> How should I do this?

Is this two questions?  I'm a little confused about the second part relating
your first part.
> $self->param("TESTING", $test_var);

does in face set the value of TESTING, AFAIK.  My code has:

$self->param( 'conf', \%conf ); # set param
$conf = $self->param( 'conf' ); # get param



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to