preface 
 
  Look_up Engine  
 
  email how to  
 
  counter  
 
  regex  
 
  search engine  
 
  home  
 
  ask us  
 

 

Perl scripting


Applications


OO Perl


Perl & Databases


Search a word:
   



© The scientific sentence. 2010

Perl Visitors counter
Visitors counter

	

Visitors counter

#!C:/Perl/bin/perl.exe -w # shebang print "Content-Type: text/html\n\n"; print "<html><head><title>Counter</title></head>\n"; print "<body>\n"; print "<table bgcolor = black><tr><td>\n"; # content header. $FILE='count.txt'; #the file $digits='Numbers'; open (THIS_FILE, $FILE) || (die ("Cannot open FILE file.\n")); flock (THIS_FILE, 2) || die ("The file FILE is being written."); $visitors= <THIS_FILE>; #the file is just a number flock (THIS_FILE, 8); close (THIS_FILE); chop($visitors); $visitors++; open (THIS_FILE, ">$FILE") || (die ("Cannot open FILE file.\n")); flock (THIS_FILE, 2) || die ("The file FILE is being written."); print THIS_FILE ("$visitors "); flock (THIS_FILE, 8); close (THIS_FILE); @digit=(); print ("<font color = white size = +1>You are the : </font>"); for ($i=0;$i<length($visitors);$i++) { $digit[$i]=substr($visitors,$i,1); print ("<IMG SRC=\"$digits/$digit[$i].gif\" valign=\"center\"> "); } print ("<font color = white size = +1> th visitor of this page. </font>"); print "</td></tr></table>\n"; print "</body></html>\n";
  
Google
Web
ScientificSentence
 




chimie labs
|
scientific sentence
|
java
|
php
|
green cat
|
contact
|


© Scientificsentence 2007. All rights reserved.