Plexus: Support Routines

Plexus Support Routines

plexus.pl

This outlines the support routines available in plexus.pl.

&error

&error($status, $msg)

Where $status is defined in the config file in %code. $msg is an arbitrary message to be included in the output.

&debug

&debug($msg)

&debug places the $msg in /tmp/plexus.debug if the $debug variable is true (defined in the config file). It's not very efficient and should only be used for debugging.

decode.pl

This outlines the support routines available in decode.pl.

&loadmask

&loadmask(*image)

Loads the data pointed to by $image{'filename'} into $image{'bits'} for use by &pixel. The $image{'width'} and $image{'height'} elements must be set before the call. The element $image{'scanlen'} is also returned.

&pixel

&pixel(*image, $x, $y)

Returns the bit at $x,$y in %image. Must have been already been loaded by &loadmask or equivalent.

&region

&region($file, $width, $height, $x, $y)

Loads the image pointed to by $file and returns the pixel value at $x,$y. This probably shouldn't be used, you should pre-load using &loadmask and save lots of effort and time.

grep.pl

This outlines the support routines available in grep.pl.

&grep

&grep($matched, $flags, $pat, *FH)

Iterates over the data stream FH looking for $pat. On matches (inverted by the v flag) it calls the routine pointed to by $matched which has access to $_. If $matched returns true the grep is halted at the current point in the input stream. The $flags available are:

i
Ignore case in pattern match.
v
Reverse the sense of the pattern test (match lines not containing $pat).
p
Paragraph mode ($_ contains the surrounding paragraph if any line matches).
________________________________________
Tony Sanders