ady has asked for the wisdom of the Perl Monks concerning the following question:
Best Regards,#!/usr/bin/perl -w use strict; use warnings; sub NEXTVAL { $_[0]->() } sub Iterator (&) { return $_[0] } sub filehandle_iterator { my $fh = shift; return Iterator { <$fh> }; } my $it = filehandle_iterator(*DATA); for (1..2) { print NEXTVAL($it); } __END__ line 1 line 2 line 3 line 4 line 5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HOP file iterator
by BrowserUk (Patriarch) on Mar 26, 2006 at 16:22 UTC | |
by ady (Deacon) on Mar 26, 2006 at 16:32 UTC | |
|
Re: HOP file iterator
by blogical (Pilgrim) on Mar 26, 2006 at 16:24 UTC |