Artur Bergman > optimize-0.03 > optimize::int

Download:
optimize-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  2
View/Report Bugs
Source   Latest Release: optimize-0.05

NAME ^

optimize::int - Turn on integer ops for specified variables

SYNOPSIS ^

    use optimize;
    my $int : optimize(int);
    $int = 1.5;
    $int += 1;
    if($int == 2) { print "$int is integerized" }

DESCRIPTION ^

Most perl operators can be turned into integer versions which do all work in integers and truncates (floors) all fractional portions. This is traditionally done by use integer; which turns on integer operations in the scope. This is usually by far too wide area to turn on those ops in.

For greater flexibility this allows you to turn on integer ops for a specific variable using the optimize attribute with an int argument, my $int : optimize(int);.

AUTHOR ^

Arthur Bergman <abergman@cpan.org>

SEE ALSO ^

optimize integer

syntax highlighting: