in reply to Re: Re: Re: Is it server configuration or my error ??
in thread Is it server configuration or my error ??
I can't stress that enough. Get into the habit early.use strict; use warnings; use diagnostics;
Use CGI.pm for your HTML output. It will make maintaining and updating your code much easier.
There is no need to double-quote your integers. You can safely say:
Your check for success on open() should be written as:
open (HANDLE, ">/path/to/file") or die "Cannot open: $!\n"
You do not need to enclose your filehandle in parenthesis when you close it. This is sufficient:
open (COUNTING, ">/path/to/counter.txt") or die "Cannot open: $!\n"; print COUNTING $myvar; close COUNTING;
If you were using CGI, you could transform the HTML you're using to something like:
You don't have to use 'lightblue' as your color also, and many browsers may not interpret that properly if used in that fashion. "How light is light?"my $query = CGI->new; print header(), $query->start_html(-title=>'My Counter', -author=>'you@domain.com', -base=>'true' -background=>'#7fb6bb');
You open and close your counter.txt file twice in the course of this script. Why not open it once, read from it, leave the handle open, and then write your data to it, then close the handle. Much less IO on the server side.
Also, more CGI.pm here: print end_html(); Maybe these tips will help you to discover your error.
Edit by tye (CODE tags in BLOCKQUOTE = too wide)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Is it server configuration or my error ??
by sOKOle (Acolyte) on Jul 18, 2002 at 12:40 UTC |