Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Resources

Status
Not open for further replies.

Waidesworld

Technical User
Oct 1, 2002
121
US
I have a CGI script in perl which calls for four different values. The file is a .txt file and the values are on different lines. The problem is that it calls the four values individually and as a result consumes 1 "cpu" of what my host is providing. My host offers 10,000 cpus a month which is about 140K less than I seem to use and I get charged for this. Any ideas?
 
Errrr... find a host that doesn't charge on such a ridiculous basis? Never heard of anyone charging for disk reads.

What is this .txt file that you're reading from? Some kind of configuration file? Maybe the file can be laid out differently (all values on one line, comma-seperated?), maybe you can get rid of it altogether (hard-code the values into your script). Maybe the real problem is an inefficient script consuming a lot of CPU time. In any case it's really a question for the perl forum ( forum219 ).

-- Chris Hunt
 
Thanks, it's a continuously updating script (every ten minutes) with travel time data. I'll try the perl forum.
 
Hey Wadesworld

I have done a wee bit of CGI scripting and I agree with Chris Hunt's suggestion - all on one line.

I created a sports draw app in Perl and all my values were stored in .txt files , separated with the '|'. Then I'd run a routine to read the file and split out the text string and assign to variables.

Happy to send you some of my code if you need some ideas - I'm only a beginner in the Perl/CGI world but what I put together seems to work OK !!!

Cheers

Nige
Kiwi-kid
nige_w@clear.net.nz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top