But I'm finding it hard to get off the ground with things to code, I have made a few simple apps like calulators and nslookup tools. So I picked up a CGI book as I run a server and thought it would be a good place to start coding something practical.
My question is I made this to start out with and what I don't understand why if all the counter code(within comments) is placed at the bottom the whole page wont display?
So I broke it up and It all comes out fine... also this seems very long winded, if anyone has any comments I would very much like to hear them. Also if anyone has any ideas for good apps/projects to get started with.#!/usr/bin/perl -w print "Content-type: text/html\n\n"; $code = "index.html"; $counter = "counter.txt"; # countercode open(COUNTER, "< $counter") or die "$_"; $hits = <COUNTER>; close(COUNTER); # countercode open(PAGE, "< $code") or die "$_"; while(<PAGE>) { chomp($_); print "$_\n"; } close(PAGE); print "<CENTER>Hits: $hits</CENTER>"; print "<CENTER>Process ID: $$ Time: $^T</CENTER><BR>"; print "</HTML>"; #countercode open(COUNTER, "> $counter") or die "$_"; $hits++; print COUNTER "$hits"; close(COUNTER); #countercode
In reply to Understanding :: by n00dles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |