The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

First - implements a simple "first match" tokenizer

SYNOPSIS

use Scanner::Stream::File;
use Scanner::Scanner;
use Scanner::First;
$tokens = [ '[A-Za-z_][A-Za-z0-9_]*', sub { print "$_[1] "; } ];
# Print all the identifiers in blah.txt
$scanner = new Scanner::First($tokens, new
    Scanner::Stream::File "blah.txt");