| Server IP : 216.92.14.13 / Your IP : 216.73.216.171 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/www/cgi-bin/ |
Upload File : |
#!/usr/bin/perl -T
#
# $Id: textclock.pl,v 1.8 2002/03/27 20:36:40 davorg Exp $
#
use strict;
use POSIX 'strftime';
use CGI 'header';
use vars qw($DEBUGGING $done_headers);
# Configuration
#
# $DEBUGGING must be set in a BEGIN block in order to have it be set before
# the program is fully compiled.
# This should almost certainly be set to 0 when the program is 'live'
#
BEGIN
{
$DEBUGGING = 0;
}
my $Display_Week_Day = 1;
my $Display_Month = 1;
my $Display_Month_Day = 1;
my $Display_Year = 1;
my $Display_Time = 1;
my $Display_Time_Zone = 1;
# End configuration
# We need finer control over what gets to the browser and the CGI::Carp
# set_message() is not available everywhere :(
# This is basically the same as what CGI::Carp does inside but simplified
# for our purposes here.
BEGIN
{
sub fatalsToBrowser
{
my ( $message ) = @_;
if ( $main::DEBUGGING )
{
$message =~ s/</</g;
$message =~ s/>/>/g;
}
else
{
$message = '';
}
my ( $pack, $file, $line, $sub ) = caller(1);
my ($id ) = $file =~ m%([^/]+)$%;
return undef if $file =~ /^\(eval/;
print "Content-Type: text/html\n\n" unless $done_headers;
print <<EOERR;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Error</title>
</head>
<body>
<h1>Application Error</h1>
<p>
An error has occurred in the program
</p>
<p>
$message
</p>
</body>
</html>
EOERR
die @_;
};
$SIG{__DIE__} = \&fatalsToBrowser;
}
my @date_fmt;
push @date_fmt, '%A' if $Display_Week_Day;
push @date_fmt, '%B' if $Display_Month;
push @date_fmt, '%d' if $Display_Month_Day;
push @date_fmt, '%Y' if $Display_Year;
push @date_fmt, '%H:%M:%S' if $Display_Time;
push @date_fmt, '%Z' if $Display_Time_Zone;
print header(-type => 'text/plain');
$done_headers++;
print strftime(join(' ', @date_fmt), localtime);