The Wayback Machine - https://web.archive.org/web/20160305070613/http://perldoc.perl.org/functions/state.html

Perl version

Modules

  • ABCDE
  • FGHIL
  • MNOPS
  • TUX

state

Perl 5 version 22.0 documentation

Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled, or are running a non-JavaScript capable web browser.

To get the best experience, please enable JavaScript or download a modern web browser such as Internet Explorer 8, Firefox, Safari, or Google Chrome.

Recently read

state

  • state VARLIST

  • state TYPE VARLIST
  • state VARLIST : ATTRS
  • state TYPE VARLIST : ATTRS

    state declares a lexically scoped variable, just like my. However, those variables will never be reinitialized, contrary to lexical variables that are reinitialized each time their enclosing block is entered. See Persistent Private Variables in perlsub for details.

    If more than one variable is listed, the list must be placed in parentheses. With a parenthesised list, undef can be used as a dummy placeholder. However, since initialization of state variables in list context is currently not possible this would serve no purpose.

    state variables are enabled only when the use feature "state" pragma is in effect, unless the keyword is written as CORE::state . See also feature. Alternately, include a use v5.10 or later to the current scope.

 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.