#
#	PerlModeFile for StrongEd. Tested with versions 4.60 & 4.611
#		and version 5.005 of Perl.
#
#	Please let me know of any anomolies or additions needed,
#	Paul Bell <dpb@chimeland.co.uk>. This incarnation 14-Mar-00.
#
#	Based on the original Perl ModeFile by Andrew Black.
#       
#HelpPath	?

# IDs not used for colouring but for SyntaxWords char matching ...
ID_FirstChar	A-Za-z_0-9@%$
ID_Middle	A-Za-z_0-9#![]'

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	No
	QuoteQuote	Yes
	SplitString	Yes
	QuoteChar	\
	HexPrefix	0x
End

SyntaxComment 1
	Type		Oneline
	StartWith	#
#	EndWith		
End

# conditionals, control flow ...
SyntaxWords Group1 case EndNonId
	default unless for while break if else elsif foreach && || or and not
	caller continue die dump eval goto last next redo xor wantarray 
End

# variables ...
SyntaxWords Group2 case EndOfId
	$ @ % @ENV
End

# subroutine, other ...
SyntaxWords Group3 case StartOfLine EndOfLine
	sub package @ISA @EXPORT #!
End

# subroutine calls ...
SyntaxWords Group4 case EndOfId
	&
End

# functions, regex/pattern matching, scoping  ...
SyntaxWords Group5 case EndNonId
	-B -e -f -o -O -R -r -T -W -w -X -x abs accept alarm atan2 bind
	binmode bless chdir chmod chomp chop chown chr chroot close closedir
	cmp connect cos crypt dbmclose dbmopen defined delete each endhostent
	endnetent endpwent endservent eof eq exec exists exp fcntl fileno
	flock fork format formline ge getc getgrent getgrgid getgrnam
	gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr
	getnetbyname getnetent getpeername getpgrp getppid getpriority
	getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid
	getservbyname getservbyport getservent getsockname getsockopt glob
	grep gt hex index int ioctl join keys kill lc lcfirst le length
	link listen local localtime log lstat lt map mkdir msgctl msgget
	msgrcv msgsnd my ne oct open opendir ord pack pipe pop pos print
	printf push quotemeta rand read readdir readline readlink readpipe
	recv ref rename reset reverse rewinddir rindex rmdir scalar seek
	seekdir select semctl semget semop send setgrent sethostent setnetent
	setpgrp setpriority setprotoent setpwentendprotoent setservent
	setsockopt shift shmctl shmget shmread shmwriteendgrent shutdown sin
	sleep socket socketpair sort splice split sprintf sqrt srand stat
	study substr symlink syscall sysopen sysread sysseek system syswrite
	tell telldir tie tied time times truncate uc ucfirst undef unlink
	unmask unpack unshift untie utime values vec wait waitpid warn write
End

# highlight some others ...
SyntaxWords Group6 case EndNonId
	exit require use import do no return
End


Search
	_Indent2	{' '} [ (("#\t") | ("# ") | ("#")) {" "} ]
	_perlsub 	"sub" _spct   @0 { AD | "_" }+ @9
	_pod		"=" @0 {AD}+ @9
	_sub_or_head	_perlsub | _pod
	_MarkWord	{' \'\(\{'}+ | { AD | '&_\.$%@\[\]!\-' }+
End


KeyList
	Return		NewLine(indent,_Indent2)
	^Return		NewLine(noindent)
End


Functions
	Key	F2
	Menu	List of Functions F2
	Icon	LoF
	Select	ListOfFound (_sub_or_head,Text,Align,Line,Case)
	Help	Click to generate a list of all the 'sub' functions.

	Adjust	ListOfWord (Text,Whole,NoLine,NoCase)

	Key 	PgUp
	Icon	up
	Select	GotoPrev (_sub_or_head ,Text,Line,Case)
	Help	Click to go to the previous function (Adjust for next).

	Adjust	GotoNext (_sub_or_head ,Text,Line,Case)

	Key 	PgDown
	Icon	down
	Select	GotoNext (_sub_or_head ,Text,Line,Case)
	Help	Click to go to the next function (Adjust for back).

	Adjust	GotoPrev (_sub_or_head ,Text,Line,Case)

	Key	F10
	Menu	Compile F10
	Icon	pl2
	Select	SetTmp() DClick ("<tmp$path>.<tmp$leaf>")
	Help	Click to run the text (Adjust will also save first).

	Key	^F10
	Adjust	SetTmp() SaveDClick ("<tmp$path>.<tmp$leaf>")

	Key	F11
	Menu	Edit ModeFile F11
	Icon	plf
	Select	SetTmp() DClick ("<tmp$mode>.ModeFile")
	Help	Click to edit the !Perl Modefile (Adjust to edit the Sprites22 file).

	Key	F11
	Adjust	SetTmp() DClick ("<tmp$mode>.Sprites22")


#	Key 	PgDown
#	Icon	pl2
#	Select	GotoNext (_sub_or_head ,Text,Line,Case)
#	Help	Click to go to the next function (Adjust for back).

#	Key 	PgDown
#	Icon	pl4
#	Select	GotoNext (_sub_or_head ,Text,Line,Case)
#	Help	Click to go to the next function (Adjust for back).

End


Shortcuts
	''el	}\n\ielse {\n\i  \@
	''ei	}\n\ielsif {\n\i  \@
	''fa	foreach $\@ (@\@) {\n\i  \@
	''fh	foreach ($\@{$\@}) {\n\i  \@
	''ir	if ($\@ =~ /\@/) {\n\i  \@
	''ie	if (($\@ = $\@) =~ /\@/) {\n\i  \@
#	''w	while (\@)
#	''fo	for (\@;\@;\@)
#	''i	if (\@) \n\i{\n\i  \@\n\i}\n\i\@
#	''k	while ( ($key , $value ) = each (%\@) )\n\i{\n\i  \@\n\i}
	''p	print "\@\\n";
	''sd	&\@("\@");
	''ss	&\@('\@');
	''oa	open ( \@ , ">>\@" ) || die  "Cant open \@ file";
	''or	open ( \@ , "<\@" ) || die  "Cant open \@ file";
	''ow	open ( \@ , ">\@" ) || die  "Cant open \@ file";
End

