Subject: | 64bit Template->new() returns undef, seamingly pointless tweak fixes it |
I suspect this is an odd library issue anomally based on:
- its 'silent/no error' behavior is erratically low level
- its always seen (so far for me anyway) on 64 bit
- to get an object created requires a seemingly pointless call (but one that
effects/is affected by low level library issues)
[as is]
[root@set cptt]# perl -Mstrict -we 'use Template ();print "OBJECT: "
. Template->new() , "\n";'
Use of uninitialized value in concatenation (.) or string at -e line 1.
OBJECT:
[root@set cptt]#
but change (Template::Base::new())
return $self->_init($cfg) ? $self : $class->error($self->error);
to
$self->_init($cfg);
return $self->_init($cfg) ? $self : $class->error($self->error);
and it works:
[root@set cptt]# perl -Mstrict -we 'use Template ();print "OBJECT: "
. Template->new() , "\n";'
OBJECT: Template=HASH(0x17b7b8d0)
[root@set cptt]#
[notes]
Doing this (changing "fix" context to non void) does not work:
my $rc = $self->_init($cfg);
return $rc ? $self : $class->error($self->error);
base _init() doesn't do anything but return the object, maybe a subclass is
acting up somewhere?