The $text argument contains the text to be parsed. The $filename argument should probably be renamed to something like $source, since it is only used to carry around the source information for generating error messages. Since the original use from prest involved only sources that were read from a file, it was called $filename. In general, it would be better for the Parse routine to allow you to pass in a line number too, so the real argument list should be
Parse($some_text, "my data file", 166)
to help people determine how to find where any parsing errors originated.
The command line options hash is just what Getopt::Long::GetOptions would return with the argument qw(d+ e:s h w=s D:s% W:s% V). In other words, if you were to invoke
prest -D include-path='<.>':/my/path -D perl-path=/my/path:'<inc>' -D image-exts=.fig=.png,.dot=.
+png,.ai=.png -D trusted -w latex my_file.rst
you would define
%opt = (D => {'include-path' => "include-path='<.>':/my/path",
'perl-path' => "perl-path=/my/path:'<inc>'",
'image-exts' => 'image-exts=.fig=.png,.dot=.png,.ai=.png',
trusted => 1
},
w => 'latex');