Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
Пример 1: В качестве ключей хэша переменные, которые определены в другом файле.
Пример 2: переменные $Event_View* определены в другом, используются только здесь и больше нигде
И так по всему коду
Задалбывает всё время переключаться alt-табом на файл, смотреть на определение переменных
my $cache_sql="SELECT `content`, `insertTime` FROM _cache WHERE `confid`='$$conf{confid}'";
...
$cache_sql.=" AND `location`=".$self->{dbh}->quote($url);
...
$cache_sql.=" AND `cgiparams`=".$self->{dbh}->quote($cgi_hash);
...
$cache_sql.=" AND `callparams`=".$self->{dbh}->quote($callp_hash);
...
$cache_sql.=" AND `userid`=".int($$params{userid});
...
$cache_sql.=" AND `groupid`=".int($$params{groupid});
my $replace_sql=$cache_sql;
$replace_sql=~s/SELECT.*?FROM\s+_cache\s+WHERE/REPLACE INTO _cache SET/s;
my $iref=$self->{ditems}->_get_item({itemid=>$weather_itemid, set=>'Weather', fields=>['MinT', 'MaxT', 'Precip', 'Cloud', 'twater'], prefix=>$$p{prefix}});
if ($$iref{$$p{prefix}.'MinT'}<0 && $$iref{$$p{prefix}.'MaxT'}<=0) {
my $tmp=$$iref{$$p{prefix}.'MaxT'};
$$iref{$$p{prefix}.'MaxT'}=$$iref{$$p{prefix}.'MinT'};
$$iref{$$p{prefix}.'MaxT'}=$tmp;
};
#warn $$iref{$$p{prefix}.'MinT'} if !$$iref{$$p{prefix}.'MinT'}>0;
$$iref{$$p{prefix}.'T'}=int( ($$iref{$$p{prefix}.'MinT'}+$$iref{$$p{prefix}.'MaxT'})/2 );
$$iref{$$p{prefix}.'T'}='+'.$$iref{$$p{prefix}.'T'} if $$iref{$$p{prefix}.'T'}>0;
#$$iref{$$p{prefix}.'T'}=~s/\-/\&\#150\;/gs;
$$iref{$$p{prefix}.'MinT'}='+'.$$iref{$$p{prefix}.'MinT'} if ($$iref{$$p{prefix}.'MinT'}>0);
$$iref{$$p{prefix}.'MaxT'}='+'.$$iref{$$p{prefix}.'MaxT'} if ($$iref{$$p{prefix}.'MaxT'}>0);
$$iref{$$p{prefix}.'twater'}='+'.$$iref{$$p{prefix}.'twater'} if ($$iref{$$p{prefix}.'twater'}>0);
$$iref{$$p{prefix}.'time'}=$$p{daystart}+$$p{hour}*3600;
#!/etc/Tivoli/bin/perl
##############################################################
# Name: Default.cgi
#
# Description: Generates translated Default HTML page
# according to browser's language
# TMF 4.1
# Licensed Materials- Property of IBM
# (C) Copyright IBM Corp. 2000. All Rights Reserved
#
# US Government Users Restricted Rights- Use, duplication,
# or disclosure restricted by GSA ADP Schedule Contract with
# IBM Corp.
##############################################################
# wupddefhtml will bind all messages contained in default page
# accordingly ( LANG is set to the browser's locale )
$defaultPage=`wupddefhtml -out`;
# all links in the default page are absolute or relative to root
# so we need to fix them because we have changed location
$defaultPage =~ s|href=|href=../|g;
$defaultPage =~ s|//|/|g;
print("HTTP/1.0 200 OK
Contents-Type: text/html
");
print "$defaultPage";
строка print("HTTP/1.0 200 OK
явно говорит о глубоких знаниях протокола :))
(C) Copyright IBM Corp. - ИТ лидер - что еще сказать