RE: passing database data to a sub

2005-04-18 Thread Charles K. Clarkson
Code review: 1: package Test_code; 2: use base 'CGI::Application'; 3: use HTML::Template; You don't need that. C::A calls it by default and you don't use it in this module. 4: use Data::FormValidator; You don't need that. I assume you'll use it later, but comment it ou

RE: passing database data to a sub

2005-04-18 Thread Charles K. Clarkson
John Doe wrote: : : return fetchall_arrayref( { HTML_ProjectName => 1 } ); : : Ok, I never used CGI::Application and HTML::Template, but : where does this sub come from? Doh! It should be this. (Again, I haven't tested this). return $sth->fetchall_arrayref( { HTM

Re: passing database data to a sub

2005-04-18 Thread John Doe
Hi Mick Just some additional comments to Charles': Am Montag, 18. April 2005 06.36 schrieb Hawkes, Mick I: > Wow! > Thanks Charles, it will take a while to digest all that. > Some questions though... > > You said: > > > Second, GetOfficers() is called as a subroutine, not as a method of an > obj

RE: passing database data to a sub

2005-04-17 Thread Charles K. Clarkson
Hawkes, Mick I wrote: : [Charles] said: : : Second, GetOfficers() is called as a subroutine, not as a method : of an object. But it is written as an object method. Try this. : $template->param( db_loop => $self->GetOfficers() ); : : I'm not sure of the difference, why

RE: passing database data to a sub

2005-04-17 Thread Charles K. Clarkson
Hawkes, Mick I wrote: : Also, I put all the changes in you recommended, but I still get the : same error! I didn't test the fetchall_arrayref() solution. You shouldn't add it until you have tested it first. : Error executing run mode 'Mode_0': can't call method

Re: passing database data to a sub

2005-04-17 Thread Jeff 'japhy' Pinyan
On Apr 18, Hawkes, Mick I said: sub mainmenu { my $self = shift; my $dbh = $self->param('mydbh'); # Get the CGI query object so that you can use the CGI.pm modules. my $q = $self->query(); # Setup the template to use for the output. my $template = $self->load_tmpl('test2.tmpl.htm'); # call p

RE: passing database data to a sub

2005-04-17 Thread Hawkes, Mick I
Wow! Thanks Charles, it will take a while to digest all that. Some questions though... You said: Second, GetOfficers() is called as a subroutine, not as a method of an object. But it is written as an object method. Try this. $template->param( db_loop => $self->GetOfficers() ); I'm not sure o

RE: passing database data to a sub

2005-04-17 Thread Charles K. Clarkson
Hawkes, Mick I wrote: : I am having trouble getting a subprocedure to work using : parameter data passed with shift Your call to the GetOfficers() looks suspect twice. First calling it with a reference ( \GetOfficers() ) doesn't look right. Have you tested the resul