Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

stupid question

Quote Reply
stupid question
I'm not sure if this should have been posted to the perl forum, but it's links related so here goes...

Being (very) rusty with perl, can anyone explain to me how to pass a links $rec information to a sub routine along with $in and $dynamic? The last call here works further up the script and everything gets passed through ok. But when trying to pass the $rec information to this sub routine, I'm getting this error message....

Can't use an undefined value as a HASH reference at .../cgi-bin/recommend_it.cgi line 115*.

I know there's a simple answer just waiting to make me look stupid - so fire away.

$rec <-- link information grabbed from database.

if ( $ENV{'REQUEST_METHOD'} eq "POST") { ## If the script has been called from a form, process it.

$rec->{'jumpback'} = $in->param('jumpback'); ## Add jump back info to the link hash.

&process_form ($in, $dynamic, $rec);

sub process_form {
# --------------------------------------------------------
my ($in, $dynamic, $rec) = @_;

## Call a sub routine in httmtemplate file, and pass the $rec informaion through to the template again.

&site_html_recommend ({ error => "Sorry an error occurred", %in, %$rec }, $dynamic) and return; #* line 115


Subject Author Views Date
Thread stupid question ryel01 2627 Oct 10, 2000, 7:54 PM
Thread Re: stupid question
Stealth 2560 Oct 10, 2000, 8:19 PM
Thread Re: stupid question
ryel01 2558 Oct 10, 2000, 8:23 PM
Thread Re: stupid question
Stealth 2548 Oct 10, 2000, 8:26 PM
Post Re: stupid question
ryel01 2544 Oct 11, 2000, 12:46 AM