state declares a lexically scoped variable, just likemy does. However, those variables will never be reinitialized, contrary to lexical variables that are reinitialized each time their enclosing block is entered.
state variables are enabled only when theuse feature "state" pragma is in effect. Seefeature.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.