Data::Page::Tied - Tied interface for the Data::Page module
use Data::Page::Tied;
$handler = tie @data,
'Data::Page::Tied',
[qw(some data to start with)],
$entries_per_page,
$current_page;
push @data, @more_data;
print "first entry on page ", $handler->current_page(),
" is ", $handler->first();
This module depends on Data::Page and Test::Simple.
The Data::Page::Tied module adds a tied interface to the
object-oriented interface defined by Leon Brocard's
Data::Page module. It also adds several methods to set
and get the current page and the number of data items per
page.
Please read the Data::Page manpage as Data::Page::Tied inherits
all methods from Data::Page.
The tying constructor has the following syntax:
tie @ary, 'Data::Page::Tied', ARRAYREF,
INTEGER, INTEGER;
Where the referenced array may contain any data to start with and the integers denote the number of entries per page and the current page respectively.
You may use the same syntax as the tied interface or you may
use the following syntax to get an ordinary Data::Page object
instead of a Data::Page::Tied object:
Data::Page::Tied->new( INTEGER, @args );
Where the integer is the number of elements.
current_page method.
entries_per_page method.
$array[$index] to.
Steffen Mueller, <page-module@steffen-mueller.net>
Copyright (C) 2002, Steffen Mueller
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.