Subject: | bug in Paginator.pm |
I just downloaded the module and tried to run the synopsis
and received this error:
Can't call method "_Prep_HTML_Text" on unblessed reference at
/usr/lib/perl5/site_perl/5.6.0/HTML/Paginator.pm line 17.
The problem is inside the new method - $obj->_Prep_HTML_Text
is called before $obj is even blessed. Simple fix, just move
the line that blesses $obj before the call to _Prep_HTML_Text.
Attached is a diff file for you convenience. Have a good one. :)
jeffa
*** Paginator.pm Wed Jun 5 03:02:26 2002
--- /usr/lib/perl5/site_perl/5.6.0/HTML/Paginator.pm Mon Dec 23 10:58:45 2002
***************
*** 14,19 ****
--- 14,20 ----
item_name => 'result',
seperator => ' | ',
href_link => $ENV{REQUEST_URI} }};
+ bless $obj, ref $pkg || $pkg;
$obj->_Prep_HTML_Text;
if ($obj->{html}->{href_link} =~ /&page\=\d+&/) {
$obj->{html}->{href_link} =~ s/&page\=\d+&/&/g;
***************
*** 41,47 ****
and $obj->{num_per_page} > 0
or return undef; # must have at least one item per page
$obj->{book} = \@_;
- bless $obj, ref $pkg || $pkg;
$obj->_Ginsoo;
return $obj;
}
--- 42,47 ----