August 1999 Return to the Perl Hardware Store Slide #33

Iterator Example

        my $it = make_iterator("access_log", "Lynx");
        $line = $it->();    # Get next line
        # Look for just the first line that has some property
        while (defined($line = $it->())) {
          print $line, last if $line =~ /LOD/;
        }


Next Copyright © 1999 M-J. Dominus