sekimura / data-page-flickrlike

Data::Page::FlickrLike
http://search.cpan.org/dist/Data-Page-FlickrLike/
6 stars 0 forks source link

EXPORT breaks things #1

Open kgoess opened 15 years ago

kgoess commented 15 years ago

Hey, Sekimura, what's this line supposed to do? There is no "navigations" subroutine defined in the current package at that line:

  our @EXPORT = qw( navigations );

It means that this code

 { package MySubclass;
   use base qw( Data::Page );
   use Data::Page::FlickrLike;
   #...
 }
 my $pager = new MySubclass();
 $pager->navigations;

fails with this error message:

Undefined subroutine &Data::Page::FlickrLike::navigations called at test.pl line 7

sekimura commented 15 years ago

you have to use like this:

 { package MySubclass;
   use base qw( Data::Page );
 }
 use Data::Page::FlickrLike;
 my $pager = new MySubclass();
 $pager->total_entries(100);
 $pager->entries_per_page(30);
 $pager->current_page(1);
 $pager->navigations;

t/03.inherit.t is the test for this. I know it looks ugly now.

yannk commented 15 years ago

Is there a reason for Data::Page::FlickrLike not to be a subclass? I'm just asking I'm not familiar with Data::Page