| 1 |
Source: libtie-array-iterable-perl |
| 2 |
Section: perl |
| 3 |
Testsuite: autopkgtest-pkg-perl |
| 4 |
Rules-Requires-Root: no |
| 5 |
Priority: optional |
| 6 |
Maintainer: Debian Perl Group <[email protected]> |
| 7 |
Uploaders: Julien Vaubourg <[email protected]> |
| 8 |
Build-Depends: debhelper (>= 10) |
| 9 |
Build-Depends-Indep: perl |
| 10 |
Standards-Version: 4.1.3 |
| 11 |
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libtie-array-iterable-perl |
| 12 |
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libtie-array-iterable-perl.git |
| 13 |
Homepage: https://metacpan.org/release/Tie-Array-Iterable |
| 14 |
|
| 15 |
Package: libtie-array-iterable-perl |
| 16 |
Architecture: all |
| 17 |
Depends: ${misc:Depends}, ${perl:Depends} |
| 18 |
Description: module allowing creation of iterators for lists and arrays |
| 19 |
Tie::Hash::Iterable allows one to create iterators for lists and arrays. The |
| 20 |
concept of iterators is borrowed from the C++ STL [1], in which most of the |
| 21 |
collections have iterators, though this class does not attempt to fully mimic |
| 22 |
it. |
| 23 |
. |
| 24 |
Typically, in C/C++ or Perl, the 'easy' way to visit each item on a list is |
| 25 |
to use a counter, and then a for( ;; ) loop. However, this requires knowledge |
| 26 |
on how long the array is to know when to end. In addition, if items are |
| 27 |
removed or inserted into the array during the loop, then the counter will be |
| 28 |
incorrect on the next run through the loop, and will cause problems. |
| 29 |
. |
| 30 |
While some aspects of this are fixed in Perl by the use of for or foreach, |
| 31 |
these commands still suffer when items are removed or added to the array |
| 32 |
while in these loops. Also, if one wished to use break to step out of a |
| 33 |
foreach loop, then restart where they left at some later point, there is no |
| 34 |
way to do this without maintaining some additional state information. |