Jan Henning Thorsen > Var-State-0.04 > Var::State

Download:
Var-State-0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.04   Source  

NAME ^

Var::State - state variable in perl 5.8

VERSION ^

0.04

SYNOPSIS ^

 use Var::State;

 sub foo {
     my $i = 0;
     my_state $i;
     return $i++;
 }

 print foo() for(0..10); # should print 0 to 10

FUNCTIONS ^

my_state(var)

Will make var (@var, $var, %var) static.

state

See LIMITATIONS.

import

Will import my_state() into the current namespace.

LIMITATIONS ^

Need to add state as a keyword, so you don't have to declare the variable with my() first. This exact problem breakes compatibility with 5.10's state, and therefore t/11-state-5.10.t is not included in the test-suite.

BUGS ^

Please report any bugs or feature requests to bug-var-state at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Var-State. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

AUTHOR ^

Jan Henning Thorsen, <pm at flodhest.net>

COPYRIGHT & LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Copyright (c) 2007 Jan Henning Thorsen