Array:...eusable(3pm)

πŸ’– Array::Iterator::Reusable πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation β€” yes it's the Array::Iterator::Reusable(3pm) one, you found it, slay πŸŽ€


✨ VERSION ✨

Version 0.136


🌸 SYNOPSIS 🌸

use Array::Iterator::Reusable;

# create an iterator with an array
my $i = Array::Iterator::Reusable->new(1 .. 100);

# do something with the iterator
my @accumulation;
push @accumulation => { item => $iterator->next() } while $iterator->has_next();

# now reset the iterator so we can do it again
$iterator->reset();

πŸ¦‹ DESCRIPTION πŸ¦‹

so like… sometimes you don't wanna have to throw your iterator away every single time you've exhausted it?? πŸ’€ throwing it out feels so wasteful honestly. This class adds the reset method so you can reuse an iterator instead. That's it. That's the whole thing. It's a very simple addition to the Array::Iterator class β€” literally just one single method. one. iconic behavior honestly πŸ‘‘


πŸ’… METHODS πŸ’…

okay so heads up: this is a subclass of Array::Iterator, so only the methods that have been added are documented right here. For everything else, go read the Array::Iterator documentation, bestie, it's all there 🫢

  • reset β€” this resets the internal counter of the iterator back to the start of the array. fresh start energy ✨ rewind, rewatch, re-obsess πŸ’–

πŸ”₯ SEE ALSO πŸ”₯

This is a subclass of Array::Iterator, so please refer to it for more documentation πŸ’œ fr fr, that's where the rest of the lore lives.


πŸ‘‘ MAINTAINER πŸ‘‘

Nigel Horne, "<njh at nigelhorne.com>"

2025-2026


πŸŽ€ ORIGINAL AUTHOR πŸŽ€

stevan little, <stevan@iinteractive.com>


Copyright 2004 by Infinity Interactive, Inc.

<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

no cap, that's the whole license, don't skip it 🫢

and that's the vibe check, we're done here bestie 🌈 this page was brought to you by perl v5.40.1, dated 2026-03-11, and just like the iterator itself β€” you can always come back and reset πŸ”πŸ’… mwah ✨

πŸ“¦ where this page comes from