homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

Rose Dbx
Docs say "variables" but two kill it

 10:56 pm on Nov 21, 2009 (gmt 0)

package myPackage::App;
use base 'CGI::Application';
use CGI::Carp 'fatalsToBrowser';
use CGI::Application::Plugin::Redirect;
use CGI::Application::Plugin::AutoRunmode;
use CGI::Application::Plugin::TT;
use CGI::Application::Plugin::Authentication;
use Rose::DBx::Object::Renderer;
use Data::Dumper;
use Clone qw(clone);

Documentation [search.cpan.org] says

A hashref of additional template variables.

Note plural.

The problem is here. "q" is used as a switch to either search the DB or display the main page.

sub my_sub : StartRunmode {
## some stuff here
return myPackage::PackageName::Manager->render_as_table(
## various parameters here, all good
extra => {
q => $self->query->param('q')
queries => { runmode => $self->get_current_runmode },

The problem: I need extra variables here for "something else." When I do this,

sub some_sub : StartRunmode {
return myPackage::PackageName::Manager->render_as_table(
extra => {
minfo => $self->get_meta_info,
q => $self->query->param('q')
queries => { runmode => $self->get_current_runmode },

q fails (no value.) I can access minfo fine because it's first. Remove it, q is fine; put q first, q is fine, minfo fails.

I tried it as shown, as an array of hashes, a hash of hashes . . . it only accesses the first hash of "extra."

Any ideas?



 4:36 am on Nov 22, 2009 (gmt 0)

<shrugs> Ahh well . . . fixed it. :-)

Something in the query->param method was borking up the values. When I did this,

my $q => $self->query->param('q');


q => $q,


It went away.

Mr Tabke, you were asking about a method of accessing programmatic functions in a thread I can no longer locate - if you're interested, I have come across something extremely cool. :-) Most of the coders here already know about it, most likely . . .

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved