This is a script meant for CGI use. You need the GD package installed in order to use this. Simply call the script in a browser and it gives you the current time as supplied by the server. Works with strict, but warnings are disabled because of uninitialized values as well as one depreceated variable :) Time returned in 12 hour format (A.M./P.M.)
#!/usr/bin/perl -T
use strict;
use GD;@_[2..3,1,rand
(1)]=((localtime)[$*++,
,1..1+1],"A.M."); $_[1]-=
12and$_[$| ]="P.M." unless$_[
rand( 1)+1]<12;$_[1]||= 12;push@_
,sprintf("%02d:%02d:%02d %s",@_[$ *
,3,2,$[]);sub _{print"Content-type: "
,$,,"image/png\n",,,$,,,$',,$_,,,''.'
';binmode STDOUT;print $_[5]->png;}$_
[5]=new GD::Image(9*length$_[4], 2*
2*2*2);$_[6]=$_[5]->colorAllocate
($|,$%,$|);$_[5]->transparent($_[
6]);$_[6]=$_[5]->colorAllocate
($ |, $%, 255 );$ _[ 5]
->string (gdGiantFont
,$|,$%,@_[4,5]);&_;
In reply to CGI Clock
by mt2k
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.