in reply to About "state" variables in Perl 5.10

citromatik,
In addition to what others have said, in the simple case (single sub), there isn't the need for the extra scope. When you need more than one sub to share, the old trick still works for that. There are many more things you can do with state though. See How will you use state declared variables in Perl6? for a more in-depth discussion. I used the state variables to create pseudo objects before Pugs had objects. You can see a perl 5.10.0 example here.

Cheers - L~R

  • Comment on Re: About "state" variables in Perl 5.10