Chess4p
view release on metacpan or search on metacpan
lib/Chess4p/Pgn/Reader.pm view on Meta::CPAN
The visitor needs to define a set of callback methods, which will be called at specific parsing
events.
=over 4
=item begin_game($visitor)
This will be called when the reader has determined that another game is available to be read.
Use this for cleaning up from any previous games read.
Return 0 to have the reader call the other callbacks as this game is read.
Return 1 to have the reader skip the game by not calling the other callbacks as this game is read.
=item end_game($visitor)
This is called immediately before the reader returns.
=item visit_header($visitor, $name, $value)
This is called when the reader has read a PGN tag with its value.
The tag name and value are returned.
=item end_headers($visitor)
Called when the reader has determined that there are no more headers to be read.
Return 0 to have the reader call the other callbacks as it reads the movetext section.
Return 1 to have the reader skip the movetext section of this game. This is useful in searching for specific
header values like player names, etc.
=item visit_comment($visitor, $comment)
The visitor has collected a (possibly multi-line) text comment, which is now available in $comment .
=item begin_variation($visitor)
( run in 0.891 second using v1.01-cache-2.11-cpan-140bd7fdf52 )