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

Tk::TextHighlight::Perl - a Plugin for Perl syntax highlighting

SYNOPSIS

Tk::TextHighlight::PerlCool inherits Syntax::Highlight::Perl;

use Tk;
require Tk::TextHighlight;

my $m = new MainWindow;

my $e = $m->Scrolled("TextHighlight",
  -syntax => "PerlCool",
  -scrollbars => "se",
  -background => "black",
)->pack(-expand => 1, -fill => "both");

$m->MainLoop;

For its limitations see also there. This module provides extra methods to provide syntax highlighting for the Perl programming language.

METHODS

highlight($string);

returns a list of string snippets and tags that can be inserted in a Tk::Text like widget instantly.

rules($txtwidget,\@list)

sets and returns a reference to a list of tagnames and options. By default it is set to:

[
   ['DEFAULT', -foreground => 'black'],
   ['Comment_Normal', -foreground => 'lightblue'],
   ['Comment_Pod', -foreground => 'lightblue'],
   ['Directive', -foreground => 'darkgreen'],
   ['Label', -foreground => 'black'],
   ['Quote', -foreground => 'green'],
   ['String', -foreground => 'green'],
   ['Variable_Scalar', -foreground => 'blue'],
   ['Variable_Array', -foreground => 'blue'],
   ['Variable_Hash', -foreground => 'blue'],
   ['Subroutine', -foreground => 'cyan'],
   ['Character', -foreground => 'magenta'],
   ['Keyword', -foreground => 'darkgreen'],
   ['Builtin_Operator', -foreground => 'darkred'],
   ['Operator', -foreground => 'darkgreen'],
   ['Number', -foreground => 'yellow'],
]
rulesConfigure($txtwidget,\@list)

Used internally. Don't call it yourself.

rulesDelete($txtwidget,\@list)
stateCompare(\@state);

Compares @state to the current state of the formatter. returns true when equal.

stateGet

Returns a list of the current state of the formatter. Called by the highlighting routines in Tk::TextHighlight.

stateSet(@list)

Sets the state of the formatter. Called by the highlighting routines in Tk::TextHighlight.

AUTHOR

Original CodeText Author: Hans Jeuken (haje@toneel.demon.nl)

PerlCool and TextHighlight Author: Jim Turner (turnerjw784@mesh.net)

BUGS

Propably plenty