- DESCRIPTION This module can be used to read in a Soar WME dump file. It exports one function, read_wm, which reads a WME dump and returns a hash pointer representing it.
- COPYRIGHT AND LICENSE
Soar::WM::Slurp - Read and parse Soar working memory dumps
use Soar::WM::Slurp qw(read_wm); use Data::Dumper; my ($WM_hash, $root_name) = read_wm(file => 'path/to/wme/dump/file'); print 'root is ' . $root_name; print Dumper($WM_hash);
Soar::WM::Slurp - Perl extension for slurping Soar WME dump files.
DESCRIPTION This module can be used to read in a Soar WME dump file. It exports one function, read_wm, which reads a WME dump and returns a hash pointer representing it.
read_wm Takes a named argument, either file => 'path/to/file', file => $fileGlob, or text => 'WME dump here'. Returns a pointer to a hash structure representing the input WME dump, and the name of the root WME, in a list like this: ($hash, $root).
Note that any incomplete WME structures will be ignored; for example:
(S1 ^foo bar ^baz boo ^link S2) (S2 ^faz far ^boo baz ^fuzz buzz
The second line in the above text will be ignored. Although some of the structure there is apparent, accepting incomplete structures would require much more error and input checking. WME dumps are normally complete, so this should not be a problem.
Nathan Glenn <email@example.com>
This software is copyright (c) 2012 by Nathan Glenn.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.