Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Weird error log messages from GLinks

Quote Reply
Weird error log messages from GLinks
Hell,

Recently my website has been migrated form the provider to the new server, and since then my error log is full with messages like:

Code:
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at /home/zaaron/public_html/www.domain.com/path/to/admin/bases.pm line 43., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at (eval 5) line 55., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com
Done a sample search on google and seems the problem is that defined is deprecated in newer perl versions (my server's perl currently is v5.12.3)

Everything seems to work fine but if I try to use debugging mode in GLinks for some reason it is absolute hell, and even without debugging enabled error log grows super fast cos this happens on every request and appearance of define keyword in code :(

GT Help :(

Somebody else noticed such thing or I'm the only one screwed from cutting edge tech :(

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Try editing the file and changing:
Code:
unless (defined %{"$base\::"}) {
to:
Code:
unless (%{"$base\::"}) {

Adrian
Quote Reply
Re: [brewt] Weird error log messages from GLinks In reply to
Thanks Adrian,

Done that and there is some improvement, however these 2 are stay, and there is no pointer in which file is line 55.

Quote:
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at (eval 5) line 55., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com

As far I understand, the perl developers have turned on deprecation warnings by default for people to notice and correct their code, but in fact the code works just fine.

Can I disable these deprecation warnings system wide?

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Found it :)

Line: 757 in GT/Template.pm

Code:
or defined &{$package . '::AUTOLOAD'} and defined %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}

Can I safely change it? to:

Code:
or defined &{$package . '::AUTOLOAD'} and %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Sorry about the delay, here's a patch that should fix all instances of it:
Code:
Index: bases.pm
===================================================================
RCS file: library/bases.pm,v
retrieving revision 1.9
diff -u -r1.9 bases.pm
--- bases.pm 13 Jan 2004 01:35:15 -0000 1.9
+++ bases.pm 13 May 2011 23:55:30 -0000
@@ -39,7 +39,7 @@
|;
eval $dcl;
die "$@: $dcl" if $@ && $@ !~ /^Can't locate .*? at \(eval /;
- unless (defined %{"$base\::"}) {
+ unless (%{"$base\::"}) {
require Carp;
Carp::croak(
qq|Base class package "$base" is empty.
Index: GT/Template.pm
===================================================================
RCS file: library/GT/Template.pm,v
retrieving revision 2.171
diff -u -r2.171 Template.pm
--- GT/Template.pm 18 Aug 2010 07:51:42 -0000 2.171
+++ GT/Template.pm 13 May 2011 23:55:30 -0000
@@ -753,7 +753,7 @@
delete $INC{"$pkg.pm"};
}
elsif (defined(&{$package . '::' . $func})
- or defined &{$package . '::AUTOLOAD'} and defined %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}
+ or defined &{$package . '::AUTOLOAD'} and %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}
) {
$ok = 1;
$code = \&{$package . '::' . $func};
Index: GT/SQL/Base.pm
===================================================================
RCS file: library/GT/SQL/Base.pm,v
retrieving revision 1.71
diff -u -r1.71 Base.pm
--- GT/SQL/Base.pm 14 May 2009 23:34:42 -0000 1.71
+++ GT/SQL/Base.pm 13 May 2011 23:55:30 -0000
@@ -587,7 +587,7 @@
if ($@) {
push @err, $@;
# In case the module had compile errors, %class:: will be defined, but not complete.
- undef %{$class . '::'} if defined %{$class . '::'};
+ undef %{$class . '::'} if %{$class . '::'};
}
else {
$ok = 1;

Adrian
Quote Reply
Re: [brewt] Weird error log messages from GLinks In reply to
Thanks Adrian,

That's much better now :)
However, this patch fails on patching Template.pm and Base.pm files, mine are respectively - Template.pm: 2.170 and Base.pm: 1.70 and I'm running GLinks 3.3.0 with all available updates installed from GT Update.

Anyway. Thanks again, fixed both files manually.

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins