FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-23-2000, 02:26 AM   Postid: 21000
brendag4
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: USA
Posts: 125
cgi calling other cgi part 2

Thanks for the tips even though they mostly went over my head :-)

I got "require" to work, at least it seems like it is.

The books I looked in recommended "use" over "require" for various reasons. The most important one to me is that "require" checks at run time and "use" checks at compile time. "Use" would seem preferrable for that reason alone.

When I try to use "use"... it complains about the subroutines and variables not being defined. I will have to see how to fix that.

Also I am worried that it will have problems compiling because I will probably want to require/use from a variable. (Right now I just did one test page, without using a variable, to see if it would work.)

Not related to the problem above... but server friendliness got mentioned here so I will ask it here...

My regular HTML files are shtml files... and I am doing this on each of them...


Code Sample:

<!--#include file=&quot;footer.htm&quot;-->




This will load a file with contact information, etc. onto each of my pages.

Is this ok to do? Would it be better to do it a different way?

Is there a list of server dos and don'ts?

Thanks :-)

Brenda
  
brendag4 is offline   Reply With Quote
Old 07-23-2000, 02:28 AM   Postid: 21001
brendag4
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: USA
Posts: 125
:-(

My smilies are broken...
brendag4 is offline   Reply With Quote
Old 07-23-2000, 01:43 PM   Postid: 21003
brendag4
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: USA
Posts: 125
What do you use instead of include.. or do you just not use anything?

If I use &quot;require&quot;... what is the best way to make sure the file is ok, since it will not be tested until runtime?

I tried to look it up in books to see how to declare my variables and subroutines.. but the ones I looked at did not explain it very well.

For example, they would say that &quot;use&quot; should be used instead of &quot;require&quot;, but then the examples would use &quot;require&quot;!

Brenda
brendag4 is offline   Reply With Quote
Old 07-24-2000, 12:17 AM   Postid: 21002
Stephen
Site Owner
 
Stephen's Avatar

Forum Notability:
89 pts: Helpful Contributor
[Post Feedback]
 
Join Date: Feb 1999
Location: L.A.
Posts: 671
you'll need to stick to using require until you've mastered a bit more perl, i think. use is for modules, meaning that if you want to use it you'll be required to turn your subroutines into a module (not recommended unless you have a really great set of routines that you want to share with others).

as for ssi calls, they're very common and (when not used to invoke cgi scripts) not server-unfriendly so i think you'll find them a recommended method of handling file inclusion (although i don't use them).

smilies here don't use a hyphen in them, e.g = : ) without the intervening space

------------------
Stephen Carter, Random Mouse Software
Solving the Customer Review Management Problem
U R L:  www.randommouse.com
Stephen is offline   Reply With Quote
Old 07-26-2000, 12:51 AM   Postid: 21004
Stephen
Site Owner
 
Stephen's Avatar

Forum Notability:
89 pts: Helpful Contributor
[Post Feedback]
 
Join Date: Feb 1999
Location: L.A.
Posts: 671
brendag4, see the other thread you began on this subject. i demonstrated there the sort of thing you should do for a require. you wrap it in an eval in case there's some kind of failure. if there is $@ will contain an error message, so you can test for it. otherwise it will be undefined. no error, then proceed. otherwise throw up an error message and quit.

i don't use includes because i prefer not to use ssi, but rather do everything via cgi. but that's because most of the pages i code for are interactive. so technically, i am an ssi clutz of course, if you don't do lots of form processing then ssi would be the way to go as it's much more server friendly in general.

------------------
Stephen Carter, Random Mouse Software
Solving the Customer Review Management Problem
U R L:  www.randommouse.com
Stephen is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:52 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.