Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: HTML::Template, CGI, passing variables, launching new script

by Lori713 (Pilgrim)
on Nov 13, 2003 at 14:12 UTC ( [id://306794]=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::Template, CGI, passing variables, launching new script
in thread HTML::Template, CGI, passing variables, launching new script

I was hoping the input type="SUBMIT" ... onclick stuff I had at the bottom of nc1_mainmenu.tmpl would allow me to pass the $CGI variables and launch the new .pl page. :-(

So....

I made the suggested changes, but I get the following error (which I've seen before but my previous code "seemed" to have eliminated it):

Can't call method "param" on an undefined value at /local/www/htdocs/scripts/campus/nc1_rpt1_summary.pl line 97.

Line 97 is about the fifth line up from the bottom of nc1_rpt1_summary.pl ({ my $val = $CGI->param($parm);). It seems to me I've declared my variables, but the program doesn't think so. The newly revised gory details are on my scratch pad since I didn't want to clutter up this post (after this is resolved, I'll post the answer so future super-searchers can find it).

Is there a better way to do this? I have done some significant reading about recursive vs. iterative, and I think I'd like to go with the iterative variation of launching the new web pages (mostly because of how I'm planning to test this junk). I was trying to make this a small example of how to pass the $CGI variables (I've only got three that I'm trying to track), so I can learn how to use the CGI module along with HTML::Template (which I'm loving, by the way!). I've already got the DBI and DBD::Sybase code working in a separate tiny file.

Thanks for any insights you can provide. If I can't (relatively) quickly resolve this particular issue, I'll backtrack and take freddo411's advice and using jeffa's example and build a tinier example from there. Thanks!

Lori

Replies are listed 'Best First'.
Re: Re: Re: HTML::Template, CGI, passing variables, launching new script
by freddo411 (Chaplain) on Nov 13, 2003 at 17:50 UTC
    The error indicates that you are asking for a parameter name that doesn't exist.

    This is a good time/place to learn some basic debugging skills. Start with the line number given in the error. Then trace back to the cause of the problem. In your case you'll start with a var ($parm) that gets set in a loop, that comes from a hard coded array that has to match the text in the HTML. Fix one or the other.

    Other helpful advice: Limit the information in your posts. The long, long listing of the template doesn't really help. Don't include templates unless the problem directly relates to the template. Even if you had to ask for help with a template, don't show us all the HMTL blah,blah,blah. Make a simple version for posting/testing that include the absolute minimum needed stuff. Like this:

    <html> <body> <!-- my_var --> </html> </body>

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://306794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-20 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found