Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: About "state" variables in Perl 5.10

by shmem (Chancellor)
on Dec 28, 2007 at 16:48 UTC ( #659352=note: print w/replies, xml ) Need Help??

in reply to About "state" variables in Perl 5.10

Since I find the latter very simple to follow and understand I would like to know if there are differences between them
Er... between what?

Do you know the difference between a hippo?

Each sub has its own scope, so sharing a lexical state variable via state $var is not an option, you have to allocate that var in an outer scope. my and state make no difference there.


_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://659352]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2021-05-15 02:32 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.