note
perlfan
For computational efficiency, you'll want to use an "iterator" pattern. Search here, there are quite a few interesting posts about this. You can also read about them in [https://hop.perl.plover.com/book/pdf/04Iterators.pdf|section 4.3.1] of Dominus' Higher Order Perl. There are also quite a few CPAN modules that might help.
11121888
11121888