XP is just a number | |
PerlMonks |
Re: idea for an static variableby duff (Parson) |
on Jul 14, 2006 at 04:29 UTC ( [id://561138]=note: print w/replies, xml ) | Need Help?? |
Perl6 has a similar thing to C-style static vars. Except they're declared with the state declarator. In the following code the variable $x will maintain its value across successive invocations of the subroutine and is only visible within the subroutine:
Perl6 is full of all sorts of interesting declarators. See http://dev.perl.org/perl6/doc/design/syn/S03.html#Declarators
In Section
Seekers of Perl Wisdom
|
|