User: Sign In
Mobile
Can
11,846 photos 2014: 311 2013: 827 | 2012: 730
Tempe
Arizona
Sedona
Search Sum
Minis Special
Exif Wide
1
5
10
12
Navigator
1.* Photos *
|
2.Best/Pano/Minis
|
3.My Adventures
|
4.Travels
|
5.Questions/Answers
|
6.Prog
|
7.Maps
|
8.Cool
Programming
1.Unix
|
2.* Perl *
|
3.PHP
|
4.ASP.NET
|
5.ASP
|
6.Visual C++
|
7.Visual Basic
|
8.JavaScript
|
9.HTML
|
10.CSS
|
11.CGI, bin and Perl
|
12.Cygwin
|
13.Linux
|
14.mySQL
|
15.Python
|
16.robertbody C++ & *.BAT
|
17.Unix Notes (live)
|
18.Perl Notes (live)
(Navigator)
1.* Photos * | 2.Best/Pano/Minis | 3.My Adventures | 4.Travels | 5.Questions/Answers | 6.Prog | 7.Maps | 8.Cool

Programming

1.Unix | 2.* Perl * | 3.PHP | 4.ASP.NET | 5.ASP | 6.Visual C++ | 7.Visual Basic | 8.JavaScript | 9.HTML | 10.CSS |
11.CGI, bin and Perl | 12.Cygwin | 13.Linux | 14.mySQL | 15.Python | 16.robertbody C++ & *.BAT |
17.Unix Notes (live) | 18.Perl Notes (live)

* Perl *

-  +
The delay in loading is due to at least 9 perl scripts getting triggered - see also [ Perl Notes (live) ]
clicking "perl: " line shows the source ....... clicking "out: " line runs the CGI script
1.Env
- why: display $ENV variables from HTML page
- perl: env.cgi
- in: /cgi-bin/pub/env.cgi?my_query_string_here&a=1&b=2
- out: run env.cgi

3.Display Perl
- why: code/HTML/text displayed in HTML
- perl: display.cgi
- in: /cgi-bin/pub/display.cgi?/cgi-bin/pub/env.cgi
- out: run display.cgi

5.Hit Counterabout
- why: displays web-page hit counter (GIF or x-bitmap)
- perl: counterc.cgi
- in1: /cgi-bin/pub/counterc.cgi?123
- in2: /cgi-bin/pub/ccounterc.cgi?123&TYPE=gif
- out1: run counterc.cgi (X-bitmap)
- out2: run counterc.cgi (GIF)
7.File Not Foundabout
- why: redirect on file-not-found
- perl: file-not-foundc.cgi + fnf.pm
- in: /cgi-bin/pub/file-not-foundc.cgi?
http://www.robertbody.com/where-is/my-/arizona.html
- out: run file-not-foundc.cgi
9.My Calendar
- why: days listing for any year 1 .. 9999
- perl: fmycal.cgi + rbh.pm
- in: /cgi-bin/pub/fmycal.cgi
- out: run fmycal.cgi
11.Pictures Count
- why: scans my website for # of pictures in each group
- perl: wc.cgi
- in: /cgi-bin/pub/www/wc.cgi
- out: see webstats or if you insist, run wc.cgi
- note: total time is typically 0 seconds...
therefore a count to 3,000,000 is done afterwards
2.Arizona Time
- why: display current time
- perl: date.cgi
- in: /cgi-bin/pub/mydate.cgi
- out: run date.cgi?state=az

4.X-bitmap counter
- why: returns X-bitmap (a picture) in HTML
- perl: bitmap.pl
- in: /cgi-bin/pub/bitmap.pl?1234&5
Count (max 10 digits) & Minimum Length
- out: run bitmap.pl - doesn't work in new IE
6.GIF counter
- why: displays web-page hit counter
- perl: gifc.cgi
- in: /cgi-bin/pub/gifc.cgi?1234
- out: run gifc.cgi

8.Who am i
- why: info about You
- perl: who.cgi
- in: /cgi-bin/pub/who.cgi
- out: run who.cgi
10.Word Scrambler
- why: Mseess up words, but you can sitll raed ok
- perl: m1.cgi
- in: /cgi-bin/pub/m1.cgi
- out: run m1.cgi (via my Popup Manager)
12.GMT Play
- why: playing with current time, GMT and others
(now duplicated with date.cgi?gmt)
- perl: gmt-play.cgi
- in: /cgi-bin/pub/gmt-play.cgi
- out: run gmt-play.cgi

(gmtime.cgi)
Note that scripts ending in "c", such as counterc.cgi and file-not-foundc.cgi
are copies of the originals used by my website and may not have all the latest changes.


Input
- why: read CGI type input
- perl: input.pl
- in: /cgi-bin/input.pl?a=123&b=456&c=789&d=482
- out:
req=GET--------------------
orig: a=123&b=456&c=789&d=482
$in[0]: a=123
$in[1]: b=456
$in[2]: c=789
$in[3]: d=482
in[a] => 123
in[b] => 456
in[c] => 789
in[z] =>
a => 123
b => 456
c => 789
d => 482

about Hit Counter
counterc.cgi is my most complex perl script here. It is trigged by HTML page loading, and handles the following:

• updating a different hit counter value for each webpage, using
-- JavaScript document.write for GIF images

• concurrent access to same page is handled by file-locking, 1 second delay, and 5 retries

• logging is done for (refer to output below):
1. current hit counter value
2. access time,
3. user ip,
4. file ID (of current page visited) and
5. the page referrer (where the page was accessed from -- Yahoo search, etc).
_2486  Thu Sep 25 12:07:38     213.10.61.56  foreign_sources.lanette -- images.google.nl/imgres?imgu :)
_4249  Thu Sep 25 11:59:46    205.188.208.8  _index 
_2485  Thu Sep 25 11:56:58    205.188.208.7  foreign_sources.lanette -- RB:mamas-heavenly-smile.html :)
_2872  Thu Sep 25 11:55:20   81.102.200.192  tools.metric-conversions
_2484  Thu Sep 25 11:55:07   205.188.209.40  foreign_sources.lanette -- RB:cool-stuff.html :)
___16  Thu Sep 25 11:54:49  205.188.209.101  foreign_sources.cool-stuff -- RB:/ :)
_2871  Thu Sep 25 11:54:15    66.255.61.139  tools.metric-conversions -- web.ask.com/web?q=how+many+ :)
_4248  Thu Sep 25 11:54:04    205.188.208.8  _index 
This shows
4248 hits, when user IP 205.188.208.8, was at main page (_index) without referrer (typed in the name), and
2871 hits, when user IP 66.255.61.139 came to my Metric Conversions page from web.ask.com.

nslookup 205.188.208.8
yields
cache-da04.proxy.aol.com
as the servername

the page referrer in the last column is truncated for readibility from something like:
http://web.ask.com/redir?bpg=http%3a%2f%2fweb.ask.com
%2fweb%3fq%3dhow%2bmany%2bfeet%2bare%2bin%2ba%2bmile%253f%26o%3d0%26page%3d1
which translates to someone typing in "how many feet are in a mile" at http://web.ask.com
(The answer to which can be found at the targetted page --> Metric Conversions )

about File Not Found
My file-not-foundc.cgi handles bad links from search engines, etc (because i have no bad links of my own :)). As a bonus it allows quickly getting somewhere, for example by changing the end to be "/map" in http://www.robertbody.com/somewhere/anywhere/map

When you click on the link, a redirect attempt occurs, matching on
(1) filename.ext (if any), else on filename (if any), or otherwise
(2) directory name, or lastly
(3) matching on a special string (eg. funny_pictures) anywhere in the path

The lookup is via hash-table, and (3) becomes the last chance of matching.
Currently [2003-10-05], while
(1) and (2) have 65 options, with match duplicates (eg. scrambler and mess trigger Word Scrambler)
(3) only has 2 entries, and may max out at 5 one day.

By clicking
file-not-foundc.cgi?http://www.robertbody.com/where-is/my-/arizona.html
and wrapping JavaScript around it, the found page is loaded.

Counter:
Last Updated: Sun, November 13, 2005 15:04