NAME
Strict ::Prototype - Improved Prototyping syntax.
SYNOPSIS
use Strict::Prototype;
sub subname ($msg) {
print "$msg\n";
}
...or...
use Strict::Prototype qw(type_checking);
sub subname (char $msg) {
print "$msg\n";
}
DESCRIPTION
Strict::Prototype
is used to allow prototypeing beyond the simple format provided by Perl.
OVERVIEW
The two uses of this module are mutually exclisive. In the simplist form, this module allows for inter-prototype variable definition similar to C. This can be used as a short cut for the common ($a,$b,$c) = @_
idiom. Because the module is based on the source filtering model, it takes a small amount of time when the script starts up to modify the code prior to the intral compilation.
The second use of this module is to add regular expression based type checking. The only types currently allowed are char
,int
,array
and hash
. In the event of a type mis-match, die is called. Because all of the Strict::Prototype
work takes place prior to script execution, it should not cause any additional memory usage during processing.
REPORTING BUGS
When reporting bugs/problems please include as much information as possible. It may be difficult for me to reproduce the problem as almost every setup is different.
A small script which yields the problem will probably be of help. It would also be useful if this script was run with $Strict::Prototype = 1
included in the program.
PREREQUISITES
This script requires the Filter
module
AUTHOR
Matt Sanford <mzsanford@cpan.org>
SEE ALSO
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.