Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

How will you use state declared variables in Perl6?

by Limbic~Region (Chancellor)
on Jul 08, 2005 at 20:21 UTC ( #473561=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/pugs
    # Demo of the state() variable declaration.
    ...
    $drawer[1]<add>( 59 );
    $drawer[2]<del>( 17 );
    say $drawer[3]<bal>();  # This should say "42"
    
  2. or download this
    sub foo () {
        state %seen;
        # ...
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://473561]
Front-paged by kutsu
help
Chatterbox?
and the pool shimmers...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-06-29 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (660 votes). Check out past polls.