Gossamer Forum
Home : Products : DBMan : Installation :

printing variables

Quote Reply
printing variables
Hello everyone-

I was wondering if someone could help me with printing variables into my HTML pages.

When I use the statment print qq! whatever !;
it prints out the same thing with the qq!.

I read through the readme file but I don't understand about using the backslashes \@ and #need; to end statement.

If I can get the variables to print, I want to put them in a formula:

exp.
A variable woud be Rate $rec{'Rate'} * 5.79 ?

Would that be correct?

I don't understand cgi that well.

Also, when I try and edit the files in a text
editor, I get an error message stating:

"Not enough memory available to complete this operation. Quit one or more apps. to increase available memory, and then try again"

I only have one program open and that is WS_FTP. So...

Thank you for all you help

cj3
Quote Reply
Re: printing variables In reply to
the web address is
http://www.joneshunter.com/script/db/db.cgi?db=default&uid=&view_search=1
Quote Reply
Re: printing variables In reply to
I'm not sure what you mean about the print qq! stuff but try to use print qq|abcd|; instead. - that's a "pipe" instead of an exclamation point.

The @ symbol is used in the perl language so the \@ tells the script that the "@" is just text and not part of the code.

Your problem with the memory just means that the program that you are using (like notepad) has a cap on the filesize that it can open - try using an HTML editor like Homesite or something similar.

Hope that helps a bit



------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: printing variables In reply to
If you want to do a calculation on one of the "$rec" variables, you'll have to do it outside of a print statement.

For example, at the beginning of html_record, after

my (%rec) = @_;

add

my ($computed_rate = $rec{'Rate'} * 5.79);

print qq|whatever goes before it.
The rate is $computed_rate.
whatever goes after it.|;


Make sense?

This also makes it easier to find in case you want to edit the multiplier later.



------------------
JPD
Quote Reply
Re: printing variables In reply to
Whe I declar my ($computed_rate = $rec{'Rate'});

I get the error:

Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Can't declare scalar assignment in my at ./html.pl line 82, near ");"

Quote Reply
Re: printing variables In reply to
Thank you for you help I got everything working for now =)